Javascript examples for jQuery:Form Textarea
Set textarea placeholder text
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://code.jquery.com/jquery-git.js"></script> <script type="text/javascript"> $(window).on('load', function() { $('button').click(function () { $('textarea').val('').attr("placeholder", "Type your answer here"); });/*from ww w . j a v a2 s .c om*/ }); </script> </head> <body> <textarea placeholder="aaa"></textarea> <button>Click me</button> </body> </html>