[Javascript] javascript and id's

Paul Novitski paul at novitskisoftware.com
Tue Oct 4 12:14:35 CDT 2005


...and of course I meant to write:

__________________________
Either:
	< input id="inputFoo" name="foo" ... />

	// point to it
	var oInput = document.getElementById("inputFoo");

		// if it exists, set its name
		if (oInput) oInput.setAttribute("name", "bar");
__________________________

NOT: 		if (oInput) oInput.setAttribute("bar");


Paul




More information about the Javascript mailing list