怎么用jQuery实现当光标移开文本框后触发事件

2025-01-16 06:16:13
推荐回答(2个)
回答1:

假如你的textbox的ID是“txtMy”: 后台的Page_Load事件中加这么段代码: protected void Page_Load(object sender, EventArgs e) { this.txtMy.Attributes.Add("onmouseout", "javascript:alert(\"离开我了\");"); } 或者直接 如果是Input标签。...

回答2:

给文本框绑定 onblur 事件
当光标移开文本框后触发