Search code examples
prototypejslabel

Change a labels for tag using Prototype?


I know I can change a labels id like this:

$(someid).id = 123;

How can I change the for, too?

This is the code I have:

<label id="10" for="xyz">
   sometext
</label>

How can I change the for from xyz to abc using Prototype?

Thanks :)


Solution

  • $(someid).writeAttribute('for', 'abc');