Class: WithContent

WithContent

new Element.WithContent(tagName)

element.js, line 76
Name Type Description
tagName string

Extends

Methods

inherited animate(options){Element}

prototypes/animations.js, line 26
Animate
Name Type Description
options Object
Returns:
Type Description
Element

inherited attr()

prototypes/dom.js, line 42
Prefer use of Element#getAttribute and Element#setAttribute

.attr(values)
.attr(name, value)
.attr(name)

inherited child(element){HTMLElement}

prototypes/dom_traversing.js, line 15
Returns the element's child[number] node
Name Type Description
element HTMLElement
Returns:
Type Description
HTMLElement

inherited empty()

prototypes/dom_manipulation.js, line 22
Remove the children's element

inherited fadeIn(options){AnimationPlayer}

prototypes/animations.js, line 48
Animate the opacity from 1 to 0
Name Type Description
options Object
Returns:
Type Description
AnimationPlayer

inherited fadeOut(options){AnimationPlayer}

prototypes/animations.js, line 36
Animate the opacity from 0 to 1
Name Type Description
options Object
Returns:
Type Description
AnimationPlayer

inherited getAttribute(attributeName){string}

prototypes/dom.js, line 168
Get an attribute of an element
Name Type Description
attributeName string
Returns:
Type Description
string

inherited getHtml(){String|null}

prototypes/dom.js, line 140
Get the inner content as html
Returns:
Type Description
String | null

inherited getProperty(propertyName){*}

prototypes/dom.js, line 177
Get a property of an element
Name Type Description
propertyName string
Returns:
Type Description
*

inherited getText(){String|null}

prototypes/dom.js, line 148
Get the inner content as text
Returns:
Type Description
String | null

inherited getValue(){*}

prototypes/dom.js, line 132
Get the value of an element
Returns:
Type Description
*

inherited hide()

prototypes/visibility.js, line 21
Hide the element (add the class .hidden)

inherited isVisible()

prototypes/visibility.js, line 53
Return if an element's visibility

inherited next(element){HTMLElement}

prototypes/dom_traversing.js, line 24
Returns the element's next sibling
Name Type Description
element HTMLElement
Returns:
Type Description
HTMLElement

inherited on(eventNames, selector, listener)

prototypes/events.js, line 129
Register a listener for a space separated list of events
Name Type Description
eventNames String
selector String optional
listener function

inherited once(eventNames, selector, listener)

prototypes/events.js, line 178
Register a listener for a space separated list of events
Name Type Description
eventNames String
selector String optional
listener function
Example

Example usage of on with a button.

$('#my-button').on('click', (event) => {
    console.log(event.$element, event.$target);
}

inherited onDelayed(delay, eventNames, selector, listener)

prototypes/events.js, line 290
Register a delayed listener for a space separated list of events Usefull for key typing events
Name Type Description
delay Number
eventNames String
selector String optional
listener function
Example

Example usage of onDelayed.

$('#input-search').onDelayed(200, 'keyup', (event) => {
    console.log(event.$element.getValue()
}

inherited parent(element){HTMLElement}

prototypes/dom_traversing.js, line 6
Returns the element's parent node
Name Type Description
element HTMLElement
Returns:
Type Description
HTMLElement

inherited previous(element){HTMLElement}

prototypes/dom_traversing.js, line 33
Returns the element's previous sibling
Name Type Description
element HTMLElement
Returns:
Type Description
HTMLElement

inherited prop()

prototypes/dom.js, line 54
Prefer use of Element#getProperty and Element#setProperty

.prop(properties)
.prop(name, value)
.prop(name)

inherited remove()

prototypes/dom_manipulation.js, line 5
Remove the element from the DOM

inherited removeAttribute(attributeName){Element}

prototypes/dom.js, line 191
Remove an attribute of an element
Name Type Description
attributeName string
Returns:
Type Description
Element

inherited setValue(value){Element}

element.js, line 43
Set value
Name Type Description
value string
Returns:
Type Description
Element

inherited show()

prototypes/visibility.js, line 5
Show the element (remove the class .hidden)

inherited stop(element, options){AnimationPlayer}

prototypes/animations.js, line 60
Stop any animations for the element
Name Type Description
element HTMLElement
options Object
Returns:
Type Description
AnimationPlayer

inherited style()

prototypes/dom.js, line 66
Prefer use of Element#getStyle and Element#setStyle

.style(properties)
.style(name, value)
.style(name)

inherited timeout()

element_prototype_and_array_prototype.js, line 24

.timeout(delay, callback($element))

inherited toggle()

prototypes/visibility.js, line 37
Toggle an element's visibility using the hidden class