文本框获取焦点事件! <input type="button" onclick="document.getElementById('tab2').getElementsByTagName('input')[0].focus()" value="ssss"> 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 function _click(i){var o=document.getElementsByTagName("input");o(i).focus();}_click(0); <html> <head> <title> </title> <script>function i2Focus(){ document.getElementById("i2").focus();}</script></head> <body> <input type="text" id="i1"> <input type="text" id="i2"> <input type="button" id="b1" onClick="i2Focus()" value="点击"></body> </html> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" ><head> <title>Untitled Page</title></head><body><table id="tab1"> <tr> <td> <input type="text" > </td> </tr> <tr> <td> <input type="text" > </td> </tr> <tr> <td> <input type="text" > </td> </tr> <tr> <td> <input type="text" > </td> </tr> <tr> <td> <input type="text" > </td> </tr> </table> <table id="tab2"> <tr> <td> <input type="text" > </td> </tr> <tr> <td> <input type="text" > </td> </tr> <tr> <td> <input type="text" > </td> </tr> <tr> <td> <input type="text" > </td> </tr> <tr> <td> <input type="text" > </td> </tr> </table> <input type="button" onclick="getFocus()"> <script type="text/javascript">function getFocus(){ document.getElementById('tab2').getElementsByTagName('input')[0].focus();}</script></body></html> 请教IE不断刷新页面,偶然会发生js脚本报错 用attachEvent绑定的onload事件为什么没有触发? 获取控件的绝对位置。谢谢 拖动表列改变table的列宽度(JavaScript脚本实现) 这个功能我已实验,如何保存到cookie. 一个刷新页面的问题 心理 FOR循环 俺又回来了,不混水圆了... 如何用javascript改变当前窗口的属性 关于用js显示图片问题! 关于数组,我总搞不清,请帮忙,100分,马上分!! javascript做的东西在firefox上没有效果 求一个联动2级菜单
var o=document.getElementsByTagName("input");
o(i).focus();
}_click(0);
<head>
<title> </title>
<script>
function i2Focus(){
document.getElementById("i2").focus();
}
</script>
</head>
<body>
<input type="text" id="i1">
<input type="text" id="i2">
<input type="button" id="b1" onClick="i2Focus()" value="点击">
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Untitled Page</title>
</head>
<body><table id="tab1">
<tr> <td> <input type="text" > </td> </tr>
<tr> <td> <input type="text" > </td> </tr>
<tr> <td> <input type="text" > </td> </tr>
<tr> <td> <input type="text" > </td> </tr>
<tr> <td> <input type="text" > </td> </tr>
</table>
<table id="tab2">
<tr> <td> <input type="text" > </td> </tr>
<tr> <td> <input type="text" > </td> </tr>
<tr> <td> <input type="text" > </td> </tr>
<tr> <td> <input type="text" > </td> </tr>
<tr> <td> <input type="text" > </td> </tr>
</table>
<input type="button" onclick="getFocus()"> <script type="text/javascript">
function getFocus(){
document.getElementById('tab2').getElementsByTagName('input')[0].focus();
}
</script>
</body>
</html>