QueryX

QueryX Documentation

Welcome to the documentation for QueryX! QueryX is a lightweight JavaScript library that provides a jQuery-like interface for DOM manipulation and traversal. It allows you to select elements, add/remove classes, manipulate attributes, traverse the DOM, and more, similar to jQuery but in a simpler and more lightweight manner.

Installation

You can include QueryX in your project by downloading the queryX.js file and adding it to your project directory. Then include it in your HTML file:

<script src="path/to/queryX.js"></script>

Alternatively, you can use a CDN link:

<script src="https://cdn.jsdelivr.net/npm/queryx"></script>

Usage

Selecting Elements

You can select elements using CSS selectors:

// Select all buttons
queryX('button');

DOM Manipulation

Adding a Class

queryX('div').addClass('highlight');

Appending Content

queryX('.container').append('<div class="new-element">New Element</div>');

Setting Attributes

queryX('input').attr('disabled', true);

Event Handling

Attaching Click Event

queryX('button').on('click', function() {
    queryX(this).toggleClass('active');
});

DOM Traversal

Finding Children

queryX('.parent').children();

Finding Closest Ancestor

queryX('.element').closest('.container');

Utility

Serializing Form Data

var formData = queryX('form').serialize();
console.log(formData);

API Reference

For detailed information on all methods and properties available in QueryX, please refer to the API Reference.

Examples

Check out the Examples for some practical use cases and code snippets.

Contributing

Contributions are welcome! If you have any suggestions, bug reports, or feature requests, please open an issue or submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.