Jump to content

Javascript Command Line Not Working


RobberBaron
 Share

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...