document.form.name.value问题来了
一个表单如下:
<form id="form" name="form">
<input type="text" name="t5" id="t5" onfocus="inputV('t5')" />
</form>
js如下:
function inputV(fldName){
document.form.fldName.value = "hello , jason";
}
这样是实现不了我要往这个input里面塞值的,他去找fldName这个name属性的的input节点了
但是我本意是想让他找name是t5的
这怎么办啊?
不能用document.getElementById这种方法,因为我不一定给input节点ID值的