0

I have a text area that is part of a form for a manageable picture gallery. When the user clicks the text area, the "Description" is supposed to disappear, and then when they click away, if they didn't type something, "Description" is supposed to reappear. The problem is is that the onfocus event isn't working.

<textarea rows="2" class="field2 c" id="gdescription"
   onfocus="if (this.value == 'Description') {this.value == ''}"
   onblur="if (this.value == '') {this.value == 'Description'}"
>Description</textarea>

EDIT: Finally realized I had "==" instead of "=".

Edited by cloud09: n/a

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by muralikalpana
0
<textarea rows="2" class="field2 c" id="gdescription"
   onfocus="if (this.className == 'field2 c') {this.value = '';this.className='';}"
   onblur="if (this.className == '') {this.value = 'Description';this.className = 'field2 c';}"
>Description</textarea>

Edited by muralikalpana: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.