Javascript examples for jQuery:Form Textarea
Use $(this) for textarea
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://code.jquery.com/jquery-1.4.2.js"></script> <script type="text/javascript"> $(window).load(function(){/*w w w . j ava 2s.c o m*/ $("textarea").click(function() { if ($(this).text() === "Something") { $(this).text(""); } }); }); </script> </head> <body> <textarea>Something</textarea> </body> </html>