NanoJQ
A tiny, lightweight JavaScript framework inspired by jQuery
$("#title").css("fontStyle", "italic");
<1 KB gzipped vs. ~ 30 KB for jQuery
Enhanced performance through focused featureset.
Only the bare utilities to make life easier
Easy as cake!
<script src="https://github.com/MoPaMo/NanoJQ/raw/main/nanojq.min.js"></script>
Use $(selector)
to select
elements. The selector can be a CSS selector string, an array of
elements, or a single element.
Returns the element at the specified index, or the entire array of elements if no index is provided.
Removes all selected elements from the DOM.
Hides all selected elements.
Shows all selected elements.
Toggles the visibility of all selected elements.
Adds an event listener to all selected elements.
Gets or sets the value of an attribute for the selected elements.
Gets or sets CSS properties for the selected elements.
Gets or sets the value of form elements.
Submits the first form element in the selection.
Gets or sets the text content of the selected elements.
Gets or sets the HTML content of the selected elements.
// Select all paragraphs and add a click event
$('p').on('click', function() {
$(this).css('color', 'red');
});
// Hide all elements with class 'hidden'
$('.hidden').hide();
// Get the value of an input
var inputValue = $('input#username').val();
// Set the HTML content of a div
$('#content').html('New content
');
// Toggle visibility of elements
$('.toggle-me').toggle();