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 wOOdy-Soft 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
Nov 5, 2002
89
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";
 

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