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 "=".

<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>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.