DOMQuery is a library that that allows users to modify DOM elements.
DOMQuery is imported by downloading DOMQuery/lib
and including it in the project directory. Wherever DOMQuery is used, include the following in the file:
const $l = require('../DOMQuery/lib/main.js');
DEMO: Snake made using this DOMQuery library
This returns a packaged node element, if given a string or object. This returns passes callbacks to another function.
This creates an asynchronous HTTP (Ajax) request.
This sets the innerHTML of each node to the given string. When no argument is provided, this returns the innerHTML of the first node.
This clears the innerHTML of the node it is called on.
This inserts content to the end of each matched element.
This gets the value of an attribute for the first element in the set of elements. When a second argument is provided, each element's attribute is set to the specified value.
This adds the specified class(es) to each element in the matched set of elements.
This removes the specified class(es) from each element in the matched set of elements.
If present, this removes the specified class. If absent, this method adds the specified class.
This retrieves the children of an element.
This retrieves the children of an element.
This gets the descendants of each element in the current set of elements, filtered by an input.
This removes the elements it is called on from the document.
This attaches event handlers to the selected elements.
This removes event handlers from the selected elements.
This constructs a new node from the element at the specified index.
This sets the content of the matched element to the specified string.