[Javascript] finding an element in the DOM sea

Steve Clay sclay at ufl.edu
Tue Jan 31 17:52:11 CST 2006


Tuesday, January 31, 2006, 9:25:34 AM, James Conley wrote:
> document.getElementById('myspan')
> document.Form1.myspan

> Which of these is "better" or is there no clear difference in what these

XHTML deprecates the name attribute on FORM elements, so in strict
documents, the form won't be accessible as a property of document. ie,
getElementById is the way forward.
http://www.w3.org/TR/xhtml1/#h-4.10

Steve
-- 
http://mrclay.org/




More information about the Javascript mailing list