Example
When the text in the d5fd7aea971a85678ba271703566ebfd element is selected, a section of JavaScript is executed:
<input type="text" onselect="showMsg() value="Hello world!">
Browser supports
IE
Firefox
Chrome
Safari
Opera
All major browsers support onselect attribute.
Definition and Usage
onselect attribute is triggered when the text in the element is selected. The
onselect attribute can be used within the following elements: d529b0750e9d0c6daa035ba6813b2e7b, 794332e4da1b97221ff0ba8bc66903c4, e98090b6b82a90f65c6c1d1640c09f00, ef2858e926d61e856e613b4641e2865f and 4750256ae76b6b9d804861d8f69e79d3.
Differences between HTML 4.01 and
HTML5
None.
Syntax
<element onselect="script">
Attribute value
Value |
Description |
script |
Script to run when onselect occurs. |
The above is the detailed content of html event triggered when the text in the element is selected onselect. For more information, please follow other related articles on the PHP Chinese website!
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn