webmonkey8
Programmer
Hello, I have a script which initially fills in the value of a form field. Upon clicking in the field to fill out, the text values disappear, which is the correct behaviour. I'm just wondering how I can get the text in the initial values to have a different font and color?
Here's my code in the <head> tag:
<script language="Javascript">
<!--
function doClear(theText) {
if (theText.value == theText.defaultValue) {
theText.value = ""
}
}
//-->
</script>
And here is the form field:
<form>
<input type="text" size=15 value="Enter URL" onFocus="doClear(this)">
</form>
I just want to have the "Enter URL" text to have a different font and color. How do I do this? Thanks.
Here's my code in the <head> tag:
<script language="Javascript">
<!--
function doClear(theText) {
if (theText.value == theText.defaultValue) {
theText.value = ""
}
}
//-->
</script>
And here is the form field:
<form>
<input type="text" size=15 value="Enter URL" onFocus="doClear(this)">
</form>
I just want to have the "Enter URL" text to have a different font and color. How do I do this? Thanks.