?
This document uses PHP Chinese website manual Release
當(dāng)文本域中的文本被選擇時(shí),顯示提示消息:
效果預(yù)覽 ?$("input").select(function(){
alert("Text marked!");
});
當(dāng) textarea 或文本類型的 input 元素中的文本被選擇(標(biāo)記)時(shí),會(huì)發(fā)生 select 事件。
select() 方法觸發(fā) select 事件,或規(guī)定當(dāng)發(fā)生 select 事件時(shí)運(yùn)行的函數(shù)。
觸發(fā)被選元素的 select 事件:
$(selector).select() 實(shí)例 ?
添加函數(shù)到 select 事件:
$(selector).select(function) 實(shí)例 ?
參數(shù) | 描述 |
---|---|
function | 可選。規(guī)定當(dāng) select 事件被觸發(fā)時(shí)運(yùn)行的函數(shù)。 |