Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

background color change with javascript

Status
Not open for further replies.

fluxdemon

MIS
Joined
Nov 5, 2002
Messages
89
Location
US
I need to find a way to change the background color of input text boxes. Is my syntax close to correct?

var tmpName = autoquote.elements;

...
tmpName.style.backgroundColor="yellow";
 
looks good from memory...

=========================================================
-jeff
try { succeed(); } catch(E) { tryAgain(); } finally { rtfm(); }
 

You haven't said what browser it's not working in... But some browsers require a full DOM path to the form:

Code:
var tmpName = document.forms['autoquote'].elements[i];

Hope this helps,
Dan

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top