madmanlear / Vanilla-js

Replacing oft-used jQuery methods with simple js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This is a small class for replicating the most often-used (by me, at least) jQuery functionality in 2kb. Examples in the index.html file.

NOT READY FOR USE IN DEVELOPMENT

Includes:

* Find elements
* Create element
* Update attributes for element
* Iterate through elements with callback
* Bind events with callback
* Empty children from element
* Load script
* Get and set text from element
* Doc Ready

Other useful shortcuts build into js:
parent = element.parentNode
clone = element.cloneNode(true)
next = element.nextSibling
html = element.innerHTML
addClass = element.classList.add("foo")
removeClass = element.classList.remove("foo")
toggleClass = element.classList.toggle("foo")
attr = element.getAttribute("foo")

About

Replacing oft-used jQuery methods with simple js


Languages

Language:JavaScript 100.0%