onselect
            收藏:0  
            阅读:45
        
        
        onselect 事件
实例
当文本被选中时,执行一段 Javascript代码:
		<input type="text" onselect="myFunction">
	
定义和用法
onselect 事件会在文本框中的文本被选中时发生。
语法
HTML 中:
		<element onselect="SomeJavaScriptCode">
	
JavaScript 中:
		object.onselect=function(){SomeJavaScriptCode}
	
| 参数 | 描述 | 
|---|---|
| SomeJavaScriptCode | 必需。规定该事件发生时执行的 JavaScript。 | 
浏览器支持
	![]()
![]()
![]()
![]()
 
所有主要浏览器都支持 onselect 事件
onselect 在 HTML 中
onselect 属性可用于: <input type="file">, <input type="password">, <input type="text">, <keygen>, 和 <textarea>.