You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's a proposal on discourse to allow the setting of multiple attribute values in much the same way that jQuery allows via .attr(PlainObject) via overloading setAttribute. I proposed there that the name setAttribute seems to imply singular attribute nature and that it would probably be both more intuitive and more successful as a standards proposal to give it another name. This is just my personal opinion, but it strikes me worth checking here to see how others feel and if anyone is planning on/willing to take up support more formally.
This is also convenient as we can’t hack around it with something like Object.assign(element.style, {}). This may also be convenient for readability if you are modifying some longAndDeep.elementReference or the presumed return of a querySelector(selector).
There's a proposal on discourse to allow the setting of multiple attribute values in much the same way that jQuery allows via
.attr(PlainObject)
via overloadingsetAttribute
. I proposed there that the name setAttribute seems to imply singular attribute nature and that it would probably be both more intuitive and more successful as a standards proposal to give it another name. This is just my personal opinion, but it strikes me worth checking here to see how others feel and if anyone is planning on/willing to take up support more formally.https://discourse.wicg.io/t/proposal-element-setattributes-object/1917/7
The text was updated successfully, but these errors were encountered: