jQuery API 返回首页目录 | jQuery API 中英文对照版
select(fn)
select(fn)

在每一个匹配元素的select事件中绑定一个处理函数。

返回值:jQuery

参数:

  • fn (Function): 在每一个匹配元素的select事件中绑定的处理函数。

示例:

$("p").select( function() { alert("Hello"); } );

HTML 代码:

<p>Hello</p>

结果:

<p onselect="alert('Hello');">Hello</p>

 
select(fn)

Bind a function to the select event of each matched element.

Return value: jQuery
Parameters:

  • fn (Function): A function to bind to the select event on each of the matched elements.

Example:

 $("p").select( function() { alert("Hello"); } );  
Before:
 <p>Hello</p>  
Result:
 <p onselect="alert('Hello');">Hello</p>  
相关链接
asp之家 | jQuery官方网站 | jQuery中文网 | 电子书作者网站 | 电子书作者blog