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

One Response to Change For Attribute for Label Tag

  1. V_X_V says:

    now I’ll be tuned..

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: