Add or change the attributes of a DOM element in a functional way.
npm install fd-setattr --save
let setattr = require('fd-setattr');
let hide = setattr('hidden', true);
hide(img);
setAttr :: name -> value -> elem
A curried function that takes in:
-
name -> Name of the attribute.
-
value -> Value for the attribute.
-
elem -> DOM element.