解决方案 »
- 如何让一个没有width属性的图片自适应宽度!
- 为什么我IE里的"脚本调试程序"打不开?
- 我的页面为啥调用不了这个jquery?
- 如何自己写时间控件
- ff能实现这种效果么
- 请教一个innerText的问题
- 请问怎么判断鼠标是否移动到了表格边框上?
- 一个棘手的问题,100分
- 有3个表单控件为s1,s2,s3。我用“s”+i,拼接表单名称,为什么总是报错?
- 怎样用js判断指定外部网页是否加载完成,如果加载失败刚重新加载,等待加载成功才执行后面代码.
- <input id="ID" name="ID" type="hidden" value="" /> 不能获取值
- 如何做到 js/javascript禁止页面F5刷新,兼容火狐和chrome呢
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
function displayInfo() {
$("#Name").val("test");
}
function Info() {
var y = $("#6 >td:eq(0)").html();
var x = $("#6 >td:eq(1)").html();
$("#ID").val(y)
$("#Name").val(x)
}
</script>
</head>
<body>
<h2>
This is a heading</h2>
<p>
This is a paragraph.</p>
<p>
This is another paragraph.</p>
<button onclick="Info()" type="button">
Click me</button>
<table width="100%">
<tr id="6" onmouseover="displayInfo()">
<td>
6
</td>
<td>
高考文库
</td>
</tr>
<tr id="7" onmouseover="displayInfo()">
<td>
7
</td>
<td>
中考文库
</td>
</tr>
</table>
<br />
<p>
数字<input class="textbox" id="ID" name="Name" type="text" value="" /></p>
文库<input class="textbox" id="Name" name="Name" type="text" value="" />
</body>
</html>
我测试了一下,可以 function Info() {
var y = $("#6 >td:eq(0)").html();
var x = $("#6 >td:eq(1)").html();
$("#ID").val(y)
$("#Name").val(x)
}infor里边可以设置参数吗? 比如: function Info(i) {
var y = $("#i >td:eq(0)").html();
var x = $("#i >td:eq(1)").html();
$("#ID").val(y)
$("#Name").val(x)
}
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
function displayInfo() {
$("#Name").val("test");
}
function Info(i) {
var y = $("#" + i + " >td:eq(0)").html();
var x = $("#" + i + " >td:eq(1)").html();
$("#ID").val(y)
$("#Name").val(x)
}
</script>
</head>
<body>
<h2>
This is a heading</h2>
<p>
This is a paragraph.</p>
<p>
This is another paragraph.</p>
<button onclick="Info(6)" type="button">
Click me ( For first row ) </button>
<button onclick="Info(7)" type="button">
Click me ( For Second row )</button>
<table width="100%">
<tr id="6" onmouseover="displayInfo()">
<td>
6
</td>
<td>
高考文库
</td>
</tr>
<tr id="7" onmouseover="displayInfo()">
<td>
7
</td>
<td>
中考文库
</td>
</tr>
</table>
<br />
<p>
数字<input class="textbox" id="ID" name="Name" type="text" value="" /></p>
文库<input class="textbox" id="Name" name="Name" type="text" value="" />
</body>
</html>
> 这个符号表示什么意思,?http://www.w3school.com.cn/jquery/jquery_ref_selectors.asp 我在这个教程上没有看到
非常感谢,测试可以了。"#6 >td:eq(0)" 中 > 的解释是什么,我在教程上没有找到
<table width="100%" style='cursor:pointer;' >