Trigger click event in textarea - Javascript jQuery

Javascript examples for jQuery:Form Textarea

Description

Trigger click event in textarea

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <script type="text/javascript" src="https://code.jquery.com/jquery-1.9.1.js"></script> 
  <script type="text/javascript">
    $(window).load(function(){/*  w  w w.j ava 2  s  .  co m*/
$(document).ready(function(){
    $('#txtid').change(function() { console.log('Value changed'); });
    $('#txtid').val('something');
    $('#txtid').trigger('change');
});
    });

      </script> 
 </head> 
 <body> 
  <textarea id="txtid" rows="5" cols="20"></textarea>  
 </body>
</html>

Related Tutorials