select-js is a lightweight JavaScript library for simple and powerful DOM manipulation. With select-js, you can easily select, manipulate, and manage your HTML elements using a straightforward API.
To install select-js, use npm:
npm install @shanto-islam/select-js
or via CDN:
<script src="https://cdn.jsdelivr.net/npm/@shanto-islam/select-js/dist/select-js.min.js"></script>
const element = select('div'); // Selects the first <div> element
const elements = selectAll('.class-name'); // Selects all elements with class 'class-name'
select('p')
.addClass('highlight')
.setText('Updated content.')
.addStyle({ color: 'red' })
.on('mouseover', () => console.log('Hovered!'));
For more examples and detailed usage, check out the documentation.