How to set the content of a textarea using jQuery?

On clicking the <a> tag,the content is dispaying inside the textarea.


 Live Demo

<script type="text/javascript">
   $(document).ready(function () {
      $("a").click(function () {
         $("#txt1").val("I AM DISPLAYING IN THE TEXTAREA");
<a id="quiresweb" class="webclass" href="#">Quires</a><br />
<label id="lbl">TEXTAREA ::</label>
<textarea id="txt1" rows="5" cols="20"></textarea><br />

Updated on: 21-Jun-2020

2K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started