Setting for attribute of a label element with object oriented method
问题 Labels have a 'for' attribute which makes them point to a certain input field. I need to change the value of this attribute with JQuery so I could use: $("label").attr("for", "targetName"); But I also need to set the className, so i'd prefer to use: $("label").attr({ for: "targetName", className: "something" }); You might allready notice the problem, for is ofcourse a keyword in javascript. Does anybody know how I could solve this? Currently i'm using the first method to set the for and the