<html><head><script type="text/javascript" src="/jquery/jquery.js"></script><script type="text/javascript">$(document).ready(function(){ $("input").select(function(){ console.log(123) $("input").after("文本被選中!"); }); $("button").click(function(){ $("input").trigger("select"); });});</script></head><body><input type="text" name="FirstName" value="Hello World" /><br /><button>激活 input 域的 select 事件</button></body></html>這個為什么點擊按鈕執(zhí)行三次,手動選中就執(zhí)行一次
jquery trigger
米琪卡哇伊
2018-10-19 14:09:16
