Skip to content

Gigoland/ioli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ioli

Version License JS

Ioli is a lightweight, modern DOM utility library. Ioli (იოლი) - თანამედროვე მსუბუქი DOM utility ბიბლიოთეკა.


Installation

Include directly:

<script src="dist/ioli.min.js"></script>

Usage

const box = ioli('#box');

box.hide();
box.show();
box.toggle();
box.addClass('active');
box.removeClass('active');
box.toggleClass('highlight');
box.html('<strong>Hello</strong>');
box.text('Plain text');
box.append('<p>Appended</p>');
box.prepend('<p>Prepended</p>');
box.attr('id', 'newId');
box.removeAttr('id');
box.val('New value');
box.css('background', 'red');
box.on('click', () => alert('Clicked!'));
box.off('click');

Example usage

ioli('box')
  .show()
  .addClass('active')
  .html('Hello')
  .on('click', () => alert('Clicked!'))
;
Method Description Example
ioli(selector) Select element(s) ioli("#box")
show(), hide(), toggle() Visibility box.show()
addClass(cls), removeClass(cls), toggleClass(cls) CSS classes box.addClass("active")
html(val), text(val) HTML / Text box.html("<b>Hi</b>")
htmlAdd(val), htmlSub(val) Modify HTML box.htmlAdd("<p>More</p>")
append(val), prepend(val), remove() DOM manipulation box.append("<p>Line</p>")
attr(name, val), removeAttr(name) Attributes box.attr("id", "newId")
val(value) Input value box.val("new")
css(prop, val) Styles box.css("color","red")
on(event, handler), off(event, handler), click(handler) Events box.on("click", handler)
isEmptyValue() Check empty box.isEmptyValue()
exists(), first(), last(), eq(index) Utilities box.first()

Live Demo

See examples/demo.html for a working demo.


License

This project is licensed under a Non-Commercial License (NC).

You are free to use, modify, and distribute this library for non-commercial purposes only. Commercial use or redistribution as part of a product or service intended for profit is not allowed without explicit permission from the author.

About

Lightweight, modern DOM utility library

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published