Shortcuts have an “for” attribute, which causes them to point to a specific input field. I need to change the value of this attribute using jQuery so that I can use:
$("label").attr("for", "targetName");
But I also need to set className, so I would rather use:
$("label").attr({
for: "targetName",
className: "something"
});
You may already have noticed the problem, because, unfortunately, the keyword is in javascript. Does anyone know how I can solve this? I am currently using the first method to set for and for the second to set several other attributes, it works, but it is not very pretty.
Any help would be greatly appreciated.
Martin
source
share