[thelist] xhtml 1.1 and javascript and w3 validation

Lachlan Cannon luminosity at members.evolt.org
Sat Dec 14 23:23:01 CST 2002


Beau Hartshorne wrote:

> <form id="widgets">
> <input type="text name="title" />
> </form>
>
> Which does validate, but which also breaks this JavaScript code (in
> Mozilla and IE):
>
> document.widgets.title.focus();
>
> Can anyone tell me if there's another attribute that I could use that
> JavaScript will know about (because JavaScript doesn't seem to be able
> to find my id attribute).

Depending on which browsers you need to support you can always use
document.getElementById('widgets');
--
Lach
__________________________________________
Web: http://illuminosity.net/
E-mail: lach @ illuminosity.net
MSN: luminosity @ members.evolt.org
__________________________________________





More information about the thelist mailing list