Reputation: 5617
I want to make a new label in mootools 1.3 by this command:
new Element('lable', {
'for':'chk_id',
'html':'hello'
}).inject(document.body);
the label will creates with 'hello' text but 'for' property dose not apply to the label. I test 'htmlFor' property, i can see this property in firebug but it does not work (I want to check an input with id='chk_id'). Is there any solution in mootools or javascript?
Upvotes: 0
Views: 612
Reputation: 26165
Perhaps using label
rather than the french-sounding lable
may be a good place to start.
Just make sure the for property matches the id of the input element.
new Element("label[for=bar][text=bar]").inject(document.body);
is fine in 1.3 :) http://jsfiddle.net/Fw9hh/
Upvotes: 1