写html时这样绑定
<input type="text" name="address4" id="address4" onFocus="open1(this);">
函数则加一个对象
function open1(ob)
{
var id=$(ob).attr("id");
alert(id);
}
本文介绍了一种在HTML中为输入框绑定焦点事件的方法,通过使用onFocus属性与自定义JavaScript函数相结合,实现了对输入框ID的捕获并弹窗显示。
写html时这样绑定
<input type="text" name="address4" id="address4" onFocus="open1(this);">
函数则加一个对象
function open1(ob)
{
var id=$(ob).attr("id");
alert(id);
}

被折叠的 条评论
为什么被折叠?