Javascript DOM HTML Input Text handle select event

Description

Javascript DOM HTML Input Text handle select event

View in separate window

<!DOCTYPE html>
<html>
<body>
Select some text: <input type="text" value="Hello world!" onselect="myFunction()">

<p id="demo"></p>

<script>
function myFunction() {/*w ww . j ava  2s .  c om*/
  document.getElementById("demo").innerHTML = "You selected some text!";
}
</script>

</body>
</html>



PreviousNext

Related