Having problems with a very simple script, I want the value of the text input to be cleared when the user clicks the box, but only if it is the default value, but it wont work.
This is the function:
Code:
function clear()
{
var text = document.getElementByName('s').value;
if(text == "Search Site...")
{
document.getElementByName('s').value="";
}
}
And this is the input:
Code:
<input type="text" size="9" name="s" value="Search Site..." onclick="clear()"/>
Any ideas?
Thanks in advance.