References

Collection of references for web development.

HTML onselect event

Description

Execute JavaScript code when the user selects the text in an input field.

Example

<div id="output"></div>
<input type="text" value="Select Me!" onselect="document.getElementById('output').innerHTML = this.value">