[thelist] javascript and IDs

Kasimir K evolt at kasimir-k.fi
Tue Oct 4 11:43:20 CDT 2005


Anthony Ettinger scribeva in 2005-10-04 16:32:
> Ok, so I have a <form id="foo">
...

> I want to change the value of an attribute of an input
> field:
> 
> <input type="text" name="foo">
> 
> want to change it to 
> 
> <input type="text" name="bar">

so how about:

document.getElementById('foo').elements['foo'].name = 'bar';

.k


More information about the thelist mailing list