Skip to content

Add or change the attributes of a DOM element in a functional way.

License

Notifications You must be signed in to change notification settings

fp-dom/fd-setattr

Repository files navigation

fd-setattr

Build Status npm version

Add or change the attributes of a DOM element in a functional way.

Installation

npm install fd-setattr --save

Usage

let setattr = require('fd-setattr');

let hide = setattr('hidden', true);

hide(img); 

API

setAttr :: name -> value -> elem

A curried function that takes in:

  • name -> Name of the attribute.

  • value -> Value for the attribute.

  • elem -> DOM element.

About

Add or change the attributes of a DOM element in a functional way.

Resources

License

Stars

Watchers

Forks

Packages

No packages published