The idea is that when a user focuses on the text box the 'Google Search' will disappear. This is the HTML<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN""http//www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html xmlns="http//www.w3.org/1999/xhtml"><head><title></title><link type="text/css" rel="Stylesheet" href="stylesheets\main.css" /><script src="script\main.js" type="text/javascript"></script></head><body><form method="get" action="http//www.google.ie/search"><p><input id="search" type="text" name="q" size="25" maxlength="255" value="Google Search"<br />
onfocus="searchFocus()" onblur="searchBlur()" /><input type="submit" value="Go" /></p></form></body></html><br />
<br />
This is the Javascript file<br />
<br />
function searchFocus() {<br />
if (search.value='Google Search')<br />
search.value=''<br />
}<br />
function searchBlur() {<br />
if (search.value='')<br />
search.value='Google Search'<br />
}<br />
<br />
What am I doing wrong?<br />
All help appreciated.<br />
I fogot to mention that when I open the page in Internet Explorer it gives me the error 'search' not defined<br />
Also I have tried changing the 'search.value' to 'this.value' in the javascript file.<br />
onfocus="searchFocus()" onblur="searchBlur()" /><input type="submit" value="Go" /></p></form></body></html><br />
<br />
This is the Javascript file<br />
<br />
function searchFocus() {<br />
if (search.value='Google Search')<br />
search.value=''<br />
}<br />
function searchBlur() {<br />
if (search.value='')<br />
search.value='Google Search'<br />
}<br />
<br />
What am I doing wrong?<br />
All help appreciated.<br />
I fogot to mention that when I open the page in Internet Explorer it gives me the error 'search' not defined<br />
Also I have tried changing the 'search.value' to 'this.value' in the javascript file.<br />