?
Dieses Dokument verwendet PHP-Handbuch für chinesische Websites Freigeben
當(dāng) textarea 或文本類型的 input 元素中的文本被選擇時(shí),會(huì)發(fā)生 select 事件。
這個(gè)函數(shù)會(huì)調(diào)用執(zhí)行綁定到select事件的所有函數(shù),包括瀏覽器的默認(rèn)行為??梢酝ㄟ^在某個(gè)綁定的函數(shù)中返回false來防止觸發(fā)瀏覽器的默認(rèn)行為。
在每一個(gè)匹配元素的select事件中綁定的處理函數(shù)。
data:select([Data], fn) 可傳入data供函數(shù)fn處理。
fn:在每一個(gè)匹配元素的select事件中綁定的處理函數(shù)。
觸發(fā)所有input元素的select事件:
$("input").select();
當(dāng)文本框中文本被選中時(shí)執(zhí)行的函數(shù):
$(":text").select( function () { /* ...do something... */ } );