[thelist] javascript - how to refer to (x)html elements

Tim Burgan burgan at iprimus.com.au
Tue Nov 11 22:48:10 CST 2003


hello,

as i've been trying to learn JavaScript - i'm a little stuck.. again

I don't know how to explain this, but instead of:

  document.formName.inputName.value
  (eg. <form name="example"> <input name="example">)

i want to use:

  document.formId.inputId.value
  (eg. <form id="example"> <input id="example" />)

the reason being, that to use the first example I must use
non-standards-compliant xhtml code in my documents.

So is there a way that JavaScript can use xhtml tag's ID elements rather than
the depreciated NAME element?

Thanks
Tim Burgan




More information about the thelist mailing list