HTML onselect event properties
Examples
When selecting <input> elements in the text after the implementation of JavaScript:
<input type="text" onselect="showMsg() value="Hello world!">
try it"
Browser Support
All major browsers support onselect event attributes
Definition and Usage
onselect properties selected text element after the trigger.
onselect property can be used for the following elements: <input type = "file">, <input type = "password">, <input type = "text">, <keygen>, and <textarea>.
Differences between HTML 4.01 and HTML5
no.
grammar
<elementonselect=" script ">
Property Value
值 | 描述 |
---|---|
script | 规定该onselect事件触发时执行的脚本。 |
HTML Event Attributes