jQuery select() handle select event

Description

jQuery select() handle select event

View in separate window


<!DOCTYPE html>
<html>
<head>
<script 
 src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js">
</script>/*from w ww  .  j av a 2 s . c  om*/
<script>
$(document).ready(function(){
  $("input").select(function(){
    $("input").after(" Text marked!");
  });
});
</script>
</head>
<body>

<input type="text" value="Hello World">

<p>Select some text inside the input field.</p>

</body>
</html>



PreviousNext

Related