DOM Methods

write Method:

The write method writes either text or html to the selected element(s).

main selector flags: all, odd, even, single, and, range

​

Parameters

param 1: String (case insensitive) value pertaining to the type of content to write, for text it will accept "text", "txt" or "textContent" for HTML content it will accept "html" or "innerHTML"

param 2: String of the content to write to the selected element

getContent Method:

The getContent method gets text based content of varying types: text, html or outer html

main selector flags: single

​

Parameters

param 1: 

To get text content the following commands are accepted "text", "txt", "textContent" or "text content". 

To get html content the following commands are accepted "html", "innerHTML", "htmlContent" or "html content". 

To get outer html content use the following commands "outer", "outerHTML", "outer html". All commands are case insensitive.

next Method:

the next method goes to the DOM element next to the selected element.

main selector flags: single

The next method can also take a parameter, the parameter must be a number. The number signifies how many elements next to the selected element to go to.

prev Method:

The prev method selects the element before the currently selected element.

main selector flags: single

The next method can also take a parameter, the parameter must be a number. The number signifies how many elements before the selected element to go to.

parents Method:

The parents method returns an array of parent elements relative to the selected element.

main selector flags: single

children Method:

The children method returns a list of child elements relative to the selected element.

main selector flags: single

The children method takes one boolean parameter. The parameter will also add text nodes to the child list as well as HTML elements.

arrayContains Method:

The arrayContains method checks an array for a particular value.

main selector flags: none

​

The arrayContains method can be used to check if a particular element exists in an array

Parameters

param 1: string value of the array item to search for

param 2: (optional) string value of the search method. If the search is for an html element via its class or id use the command "id" or "identifier"

if the search if for a class, id or tag name then use the command "both" or "all"

make Method:

The make method makes elements and places them as child elements to the selected parent element(s)

main selector flags: all, odd, even, single, and, range

Parameters

param 1: String value of the type of element to make

param 2: Number value of how many elements to make

param 3: (optional) String value of the type of attribute to give the element. If this parameter is not used the main query selector will be overridden by the newly created element.

param 4: (required if using param 3) String value of the attribute's value

changeCase Method:

The changeCase method changes the case of text, there are 4 different settings for this method.

main selector flags: all, odd, even, single, and, range

Parameters

param 1:

Uppercase commands: "upper", "upperCase", "upper case", "to upper" or "toUpper"

Lowercase commands: "lower", "lowerCase", "lower case", "to lower" or "toLower"

Title case commands: "title", "heading" or "camel"

Sentence case commands: "sentence"

limit Method:

The limit method reduces the amount of text within the selected element to a specified amount.

main selector flags: all, odd, even, single, and, range

Parameters

param 1: String value of what method to limit text by. 

Limit by word commands: "word", "words" or "wrd"

Limit by letter commands: "letter", "lttr", "ltr", "char" or "character"

param 2: A number value of how how many letters or words can exist

param 3: String value of how to end off the limited text content, this can be text of any kind, commonly "..."

iframe Method:

The iframe method accesses content inside an iframe.

main selector flags: single

Parameters

param 1: String value that takes a command pointing to which part of the iframe to access. If no value is passed in the return value would just be the iframe document. Valid commands are "head" or "body".

designMode Method: 

The designMode method enables the editing of an iframe.

main selector flags: single

Parameters

param 1: String value, to enable editing write "on" and to disable editing write "off"

editable Method:

The editable method enables editing on html element(s).

main selector flags: all, odd, even, single, and, range

Parameters

param 1: Boolean value to enable or disable editing of html element(s)

create Method:

The create method creates an element without appending it anywhere.

main selector flags: none

Parameters

param 1: String value of the element to create.

param 2: (optional) How many elements to create

param 3: (optional) An attribute to give the element(s)

param 4: (required if using param 3) the value of the attribute

prepend Method:

The prepend method inserts an element before another element. For this to work correctly the main selector must be the parent of the element you want to insert a new element before.

main selector flags: single

Parameters

param 1: The new element to insert

param 2: The element to insert the new element before

append Method:

The append method appends a newly created element.

main selector flags: single

parameters

param 1: The element to append

parent Method:

The parent method gets the parent element relative to the selected element.

main selector flags: single

Parameters

param 1: A number value of how many parent elements to ascend to. The number value is indexed at 0.

child Method:

The child method gets the child element relative to the selected element.

main selector flags: single

Parameters

param 1: A number value of how many child elements to descend to. The number value is indexed at 0.