Change For Attribute for Label Tag

This is a way to change for attribute value for label with Javascript.

<label id=”myLabel” for=”something”>my label</label>

Normal way:

document.getElementById(‘myLabel’).htmlFor = “another thing”;

Prototype JS way:

$(‘myLabel’).htmlFor = “another thing”;

Advertisements