2.0.0 • Published 2 years ago

@codebundlesbyvik/element-operations v2.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

element-operations

npm npm - downloads per week

JavaScript helper functions for working with element objects.

Installation

// Install package from npm
npm install @codebundlesbyvik/element-operations
import createEl from "@codebundlesbyvik/css-operations";

Functions

createEl(tagName, attrs)

Create an Element and return it.

Parameters

* indicates required

  • * tagName (String): Element's tag name.
  • attrs (Object): Object containing the Element's individual property - value pairs.

Usage

createEl("div", {
    class: "example-div",
    id: "example-div-1",
    ariaHidden: "true"
})
// > <div class="example-div" id="example-div-1" aria-hidden="true"></div>

License

MIT © Viktor Chin-Kon-Sung