I’ve no idea why this isn’t working, but I’m sure it’s a very common bit of Javascript. My syntax is clearly lacking, and I don’t know why:
<input type="text" value="search" id="search" name="q" onclick="javascript:if($(this).val() == 'search') {$(this).val() = '';} return false;" />
Your issue is with this line of code:
The proper way to set a value in jQuery is:
In addition, inline JS is never a good idea. Use this instead:
Here’s a working fiddle.
References: jQuery
.val()