vinodh vinodh - 5 months ago 11
Javascript Question

How to Click the textarea automatically?

HTML Code



<textarea id="id1">
Contents inside
</textarea>


Html 5



we can use auto focus for directly click the textarea. But i want to achieve without using autofocus. We may use Jquery and Js.

Any Idea ?

Answer

Try this -

$(document).ready(function() {
  $('#id1').trigger('click');
});
Comments