The onselect
attribute event is triggered
after selecting text in an element.
None.
<elementName onselect="script">
<input type="file">, <input type="password">, <input type="text">, <keygen>, <textarea>
onselect |
Yes | Yes | Yes | Yes | Yes |
<!DOCTYPE html>
<html>
<body>
<!-- www. j a v a2s . co m-->
Some text: <input type="text" value="Select me!!" onselect="myFunction()">
<script>
function myFunction() {
console.log("You have selected some text!");
}
</script>
</body>
</html>