document.getElementById(tdId).innerHTML=document.getElementById(tdId).innerHTML+"<IMG src=imgs/vasave.png border=0 width=16 height=16 onclick=\"vasubmit();\" onload=\"document.getElementById("+tdId.replace("id_","input_")+").focus();\" style='cursor:hand'>";
("id_","input_")).value);alert(document.getElementById(tdId.replace("id_","input_")).name);document.getElementById(tdId.replace("id_","input_")).focus();这样的代码运行后,弹出警告框后,会聚焦到<input>控件上。可是我把alert注释掉,就无法直接聚焦。代码如下:document.getElementById(tdId).innerHTML=document.getElementById(tdId).innerHTML+"<IMG src=imgs/vasave.png border=0 width=16 height=16 onclick=\"vasubmit();\" onload=\"document.getElementById("+tdId.replace("id_","input_")+").focus();\" style='cursor:hand'>";
("id_","input_")).value);//alert(document.getElementById(tdId.replace("id_","input_")).name);document.getElementById(tdId.replace("id_","input_")).focus();我的需求是直接聚焦,请问如何实现?
("id_","input_")).value);alert(document.getElementById(tdId.replace("id_","input_")).name);document.getElementById(tdId.replace("id_","input_")).focus();这样的代码运行后,弹出警告框后,会聚焦到<input>控件上。可是我把alert注释掉,就无法直接聚焦。代码如下:document.getElementById(tdId).innerHTML=document.getElementById(tdId).innerHTML+"<IMG src=imgs/vasave.png border=0 width=16 height=16 onclick=\"vasubmit();\" onload=\"document.getElementById("+tdId.replace("id_","input_")+").focus();\" style='cursor:hand'>";
("id_","input_")).value);//alert(document.getElementById(tdId.replace("id_","input_")).name);document.getElementById(tdId.replace("id_","input_")).focus();我的需求是直接聚焦,请问如何实现?
解决方案 »
- 请教 js 中的confirm弹出对话框后可以让自动确定么?
- ECMAScript 引用类型(六)
- 关于jquery.autocomplete控件
- java解析json数据
- 简单ajax和js校验!!郁闷我一下午了!!
- 简单的关于JS乘法计算问题........请路过的指点指点.
- 【求助】在单独的js文件中使用“document.getElementById”方法找不东西????
- 在用一个页面中,怎么将一个列表中选择的选项传递到另外一个列表中?
- 请问这条语句错在哪里?
- Extjs4.1 numberfield控件spindown不响应
- 关于无限循环,在线等,急需
- 求一段点击连接后才显示的JS代码
document.getElementById(tdId).innerHTML=document.getElementById(tdId).innerHTML+" <IMG src=imgs/vasave.png border=0 width=16 height=16 onclick=\"vasubmit();\" onload=\"document.getElementById('"+tdId.replace("id_","input_")+"').focus();\" style='cursor:hand'>";
//("id_","input_")).value); 这里是什么代码???//alert(document.getElementById(tdId.replace("id_","input_")).name); document.getElementById(tdId.replace("id_","input_")).focus();