Kind: global class
- Quantdom
- .each(handler)
- .exists() ⇒
boolean
- .parent() ⇒
Quantdom
- .siblings() ⇒
Quantdom
- .children() ⇒
Quantdom
- .find([selector]) ⇒
Quantdom
- .findEl([selector]) ⇒
HTMLElement
- .findEls([selector]) ⇒
Nodelist
- .el([index]) ⇒
HTMLElement
- .lastEl() ⇒
HTMLElement
- .els() ⇒
Nodelist
- .on(event, listener)
- .off(event, listener)
- .append(html)
- .prepend(html)
- .before(html)
- .after(html)
- .attr(attr, value) ⇒
string
- .hide([aria])
- .show([aria])
- .html([html]) ⇒
string
- .text([newValue]) ⇒
string
- .val([newValue]) ⇒
*
- .addClass(className)
- .removeClass(className)
- .toggleClass(className)
- .css(prop, [value]) ⇒
- .docReady(cb)
executes a function on each iteration on the list of elements.
Kind: instance method of Quantdom
Param | Type | Description |
---|---|---|
handler | function |
A function to run on each iteration |
checks if element exists by checking the elements nodelist length & is an alias for exists i.e. $('.selector').exists
Kind: instance method of Quantdom
Returns: boolean
- returns true if element exists
quantdom.parent() ⇒ Quantdom
returns the parent of the first element that matches the selector
Kind: instance method of Quantdom
Returns: Quantdom
- Returns parent of first element that matches the selector
quantdom.siblings() ⇒ Quantdom
returns the siblings of the first element that matches the selector
Kind: instance method of Quantdom
Returns: Quantdom
- Returns siblings of first element that matches the selector
quantdom.children() ⇒ Quantdom
returns the children of the first element that matches the selector
Kind: instance method of Quantdom
Returns: Quantdom
- Returns children of first element that matches the selector
quantdom.find([selector]) ⇒ Quantdom
returns the first element that matches the selector in children of the selected node
Kind: instance method of Quantdom
Returns: Quantdom
- returns first element that matches the selector
Param | Type | Description |
---|---|---|
[selector] | string |
query selector to search for |
returns first element that matches the selector in children of the selected node
Kind: instance method of Quantdom
Returns: HTMLElement
- returns first element that matches the selector
Param | Type | Description |
---|---|---|
[selector] | string |
query selector to search for |
returns elements that matches the selector in children of the selected node
Kind: instance method of Quantdom
Returns: Nodelist
- returns nodelist of that matches the selector
Param | Type | Description |
---|---|---|
[selector] | string |
query selector to search for |
returns first element in an array of elements with same selector, acts like document.querySelector
Kind: instance method of Quantdom
Returns: HTMLElement
- an element in the array of elements you want to use
Param | Type | Description |
---|---|---|
[index] | integer |
index of element to return |
returns last element in an array of elements with same selector
Kind: instance method of Quantdom
Returns: HTMLElement
- last element in array of elements you want to use
returns all matching elements, alias for querySelectorAll
Kind: instance method of Quantdom
Returns: Nodelist
- a nodelists
adds an event on an element(s)
Kind: instance method of Quantdom
Param | Type | Description |
---|---|---|
event | string |
type of event to add to element |
listener | function |
event listener function to execute on event |
removes an event on an element(s)
Kind: instance method of Quantdom
Param | Type | Description |
---|---|---|
event | string |
type of event to add to element |
listener | function |
event listener function to remove |
Appends an html string to a dom element(s)
Kind: instance method of Quantdom
Param | Type | Description |
---|---|---|
html | string |
html string to append to DOM |
prepends a html string to a dom element(s)
Kind: instance method of Quantdom
Param | Type | Description |
---|---|---|
html | string |
string of html to prepend |
inserts a html string to dom right before element(s)
Kind: instance method of Quantdom
Param | Type | Description |
---|---|---|
html | string |
string of html to prepend |
inserts a html string to dom right after element(s)
Kind: instance method of Quantdom
Param | Type | Description |
---|---|---|
html | string |
string of html to prepend |
sets an element(s) attribute or returns first element attribute value
Kind: instance method of Quantdom
Returns: string
- value of first occurrence of element attribute
Param | Type | Description |
---|---|---|
attr | string |
an attribute |
value | any |
a value to set attribute |
adds display none from css inline styles
Kind: instance method of Quantdom
Param | Type | Description |
---|---|---|
[aria] | boolean |
if true sets ara-hidden to true instead of setting inline display style to none |
removes display none from and element(s) css inline styles
Kind: instance method of Quantdom
Param | Type | Description |
---|---|---|
[aria] | boolean |
if true sets ara-hidden to false instead of removing inline display style |
inserts/replaces html or returns html of an element(s)
Kind: instance method of Quantdom
Returns: string
- html of first occurrence of element
Param | Type | Description |
---|---|---|
[html] | string |
html to insert into dom |
inserts/replaces text or returns text of an element(s)
Kind: instance method of Quantdom
Returns: string
- text of first occurrence of element
Param | Type | Description |
---|---|---|
[newValue] | string |
text to insert into dom |
gets a value of first html element or sets a new value of all HTML Element(s)
Kind: instance method of Quantdom
Returns: *
- value of first occurrence of element
Param | Type | Description |
---|---|---|
[newValue] | * |
a new value to set |
adds a class to the selected element(s)
Kind: instance method of Quantdom
Param | Type |
---|---|
className | string |
removes a class from the selected element(s)
Kind: instance method of Quantdom
Param | Type |
---|---|
className | string |
toggles a class on selected element(s)
Kind: instance method of Quantdom
Param | Type |
---|---|
className | string |
sets a style on element(s) or returns the style property value
Kind: instance method of Quantdom
Returns: computed style of element
Param | Type | Description |
---|---|---|
prop | string |
css property to get or set |
[value] | * |
value to set styles |
wrapper to run code that needs to wait for DOM to be fully loaded
Kind: instance method of Quantdom
Param | Type | Description |
---|---|---|
cb | callback |
a callback to run once the DOM is ready |