Jump to content

Javascript Command Line Not Working


RobberBaron

Recommended Posts

I have a search input box on my site that has the text 'Search Term' in the style 'font-style:italic; color:A4A4A4;'. When you click it, it's supposed to run a Javascript command that changes the style to normal and the font color to black. This doesn't work. The exact command:

<input type="text" id="query" name="query" value="Search Term" onclick="java script:if (this.value='Search Term') { this.value=''; this.style='color:#000000;'; } this.style='color:#000000;';" style="color:#A4A4A4; font-style:italic;" onfocus="java script: if (this.value='Search Term') { this.value=''; } this.style=''; " />

It makes it blank when you click it, but the style remains. Can someone help?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...