Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 

README.md

setAttributes

Set and delete multiple attributes in a DOM element.

This...

var el = document.querySelector('input')

el.setAttribute('type', 'password')
el.setAttribute('name', 'password-field')
el.removeAttribute('maxlength')

...is equivalent to this:

var setAttributes = require('setattributes')

var el = document.querySelector('input')

setAttributes(el, {
  type: 'password',
  name: 'password-field',
  maxlength: null
})

About

call .setAttribute on a DOM node more easily

Resources

License

You can’t perform that action at this time.