Like This Site? 
 
RSS Feed Follow Us 

on Twitter! Be Our Fan!

JavaScript :How to delete default text when selecting a textarea

Share this post!
 Vote this!

The text inside the textarea will disappear when the area is selected, and reappear when the area is not selected and there's no text inside it. To do so, we are going to use JavaScript.
The HTML 
<textarea class="notselected" id="textarea" onfocus="change('selected'); empty();" onblur="change('notselected'); empty();">Add your comment here...</textarea>
More... 

0 comments:

Post a Comment