-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
set attributes w/multi-values #60
Comments
The convenience of this method would be to clearly group attribute assignments so they are easier to read and understand. element.setAttributes({
id: 'nav-item-1',
class: 'nav-item',
'aria-controls': 'nav-item-1-submenu',
'aria-haspopup': true,
'aria-expanded': false
}) This is also convenient as we can’t hack around it with something like |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: