35

femtoJS - Really small JavaScript (ES6) library for DOM manipulation

 5 years ago
source link: https://www.tuicool.com/articles/hit/6BZRnaE
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

neEFRjJ.png!webfemtoJS

Really small JavaScript (ES6) library for DOM manipulation.

femtoJS is less than 20 lines of code (0.4 Kb compressed and gziped) JavaScript library for basic DOM manipulation. It has jQuery like syntax and supports chaining.

Because is so small and simple you can add or remove methods directly in the library, meaning is very customizable. All methods are unrelated so removing one will not affect the library in any way.

Use this library as starting point and personalise it so it can meet your needs.

Here are some code examples:

$(".someClass").css("background-color:green;").html("Hello World");
$("#a").on("click", function(){

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

})

It works in ES6 supported browsers.

Mby2aa7.png!web

Here is the list of all the methods:


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK