English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
onselect wird verwendet, um den Ereignishandler für das select-Ereignis des aktuellen Fensters zu erhalten oder zu setzen
Führe JavaScript aus, nachdem einige Text im <input>-Element ausgewählt wurden
<!DOCTYPE html> <html> <head> <title>Verwendung der HTML onselect-Eventattribut (Grundlagen-Tutorial-Website oldtoolbag.com)</title> <script> function showMsg() { alert("Du hast einige Textinformationen ausgewählt!"); } </script> </head> <body> Einige Text: <input type="text" value="Wähle mich!!" onselect="showMsg()"> <p>showMsg() function is triggered when text information in the input field is selected. This function pops up some information./p> </body> </html>Test see ‹/›
IEFirefoxOperaChromeSafari
All major browsers support the onselect event attribute
The onselect attribute is triggered when some text is selected in the element.
The onselect attribute can be used with the following elements: <input type="file">, <input type="password">, <input type="text">, <keygen>, and <textarea>.
No differences.
<element onselect="script">
Value | Description |
---|---|
script | Specifies the script to be executed when the onselect event is triggered. |