Minimal standalone JS library for DOM manipulation
Clone or download
Latest commit 47f6bc8 Dec 13, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lab define eq function Jun 7, 2018
lib First Commit May 20, 2018
logos new logo Jun 1, 2018
src update Dec 13, 2018
.gitignore Create .gitignore May 25, 2018
LICENSE MIT License May 24, 2018
README.md Update README.md Dec 13, 2018
animate.html adding lab folder with new features Jun 1, 2018
css.html adding lab folder with new features Jun 1, 2018
docs.md Add siblings Aug 17, 2018
mission.md Adding mission.md May 28, 2018
nanoJS.html adding lab folder with new features Jun 1, 2018
of-onn.html adding lab folder with new features Jun 1, 2018
package.json Update Dec 13, 2018
sun.html adding lab folder with new features Jun 1, 2018

README.md

nanoJS

License MIT Gzip Size npm

Minimal standalone JS library for DOM manipulation

nanoJS is around 100 lines of code (0.8 Kb compressed) JavaScript library for basic DOM manipulation. It has jQuery like syntax and supports chaining.

Syntax demos:

$(".someClass").css("background-color:green;").html("Hello World");

$('#c').animate('2.3', '1.2','0','1','1','0','0', '0','0','1').css('background-color:red').text('Hello');

$("#a").on("click", function(){

  $("#someDiv").css("background-color:green;color:#fff;");

})

You can find it here some basic examples. also the Mission & Philosophy of nanoJS

It works in IE9 and later. (some methods addClass, removeClass and toggleClass will not work in IE9)

Read more here:

https://vladocar.github.io/nanoJS/

or on my blog:

http://www.vcarrer.com/2018/05/nanojs-javascript-for-dom-manipulation.html

You can use direct download or:

npm i @vladocar/nanojs
yarn add @vladocar/nanojs
<script src="https://unpkg.com/@vladocar/nanojs@1.0.8/src/nanoJS.min.js"></script>

OR

<script src="https://cdn.jsdelivr.net/npm/@vladocar/nanojs/src/nanoJS.min.js"></script>

Utils:

addClass
animate
attr
css
cssdom
empty
eq
getAttr
html
insertAfter, insertBefore, insertFirst insertLast
offset
on
parent
removeAttr
removeClass
siblings
text
toggleClass