Class: QueryObject

ko/dom~ QueryObject


QueryObject()

Methods


<static> addClass(className)

Adds given class

Parameters:
Name Type Description
className String

The class name

Returns:

this


<static> after(value)

Insert content after element

Parameters:
Name Type Description
value string | object

String or queryObject

Returns:

this


<static> append(elem)

Append content to elem

Parameters:
Name Type Description
elem element
Returns:

this


<static> appendTo(elem)

Append elem to another element

Parameters:
Name Type Description
elem element
Returns:

this


<static> attr(key, value)

Set/get attributes

Parameters:
Name Type Description
key String | Object

The attribute key

value Mixed | Undefined

The attribute value, or empty if you just want to retrieve it

Returns:

this


<static> before(value)

Insert content before element

Parameters:
Name Type Description
value string | object

String or queryObject

Returns:

this


<static> childCount()

Get number of child nodes

Returns:
Type
int

<static> children()

Get child nodes

Returns:
Type
queryObject

<static> clone()

Clone matched element

Returns:

matched element

Type
Element

<static> css(key, value)

Set/get CSS value(s)

Parameters:
Name Type Description
key String | Object

The CSS property name, or an object with css properties/values

value Mixed | Undefined

The CSS property value, or undefined if first arg was an object

Returns:

this


<static> delete()

Delete matched elements

Returns:

this


<static> each(action)

Iterate over matched elements

Parameters:
Name Type Description
action function

The function to call on each iteration

Returns:

this


<static> element()

Get first matched element, without wrapping it in a queryObject

Returns:
Type
Element

<static> empty()

Empty the contents of an element

Returns:

this


<static> exists()

Checks if element exists

Returns:
Type
Boolean

<static> find()

Find within current element

Returns:
Type
queryObject

<static> first()

Get first matched element

Returns:
Type
queryObject

<static> focus()

Focus on element

Returns:

this


<static> hasClass(className)

Checks for given class

Parameters:
Name Type Description
className String

The class name

Returns:

this


<static> hide()

Makes element invisible by setting the visibility attribute

Returns:

this


<static> html(value)

Set html content of elem

Parameters:
Name Type Description
value string | object

String or queryObject

Returns:

this


<static> last()

Get last matched element

Returns:
Type
queryObject

<static> next()

Get the next sibling for the first element in the selection

Returns:
Type
queryObject

<static> off(event, action)

Remove event listener

Parameters:
Name Type Description
event Event

String event type i.e 'click'

action function

Callback function

Returns:

this


<static> on(event, action)

Add event handler

Parameters:
Name Type Description
event Event

String event type i.e 'click'

action function

Function

Returns:
Type
this

<static> once(event, action)

Add an event listener which only receives a callback once

Parameters:
Name Type Description
event Event

String event type i.e 'click'

action function

Callback function

Returns:
Type
this

<static> outerHtml()

Get outer html of elem

Returns:

this


<static> parent()

Retrieve parent node

Returns:

Parent node

Type
Element

<static> prepend(value)

Prepend content to elem

Parameters:
Name Type Description
value string | object

String or queryObject

Returns:

this


<static> prev()

Get the previous sibling for the first element in the selection

Returns:
Type
queryObject

<static> removeAttr(key)

Remove Attribute

Parameters:
Name Type Description
key String

The attribute key

Returns:

this


<static> removeClass(className)

Remove given class

Parameters:
Name Type Description
className String

The class name

Returns:

this


<static> replaceWith(elem)

Replace matched element(s) with ..

Parameters:
Name Type Description
elem Element

The element

Returns:

returns replaced element

Type
Element

<static> reverse()

Reverse the element array

Returns:

this


<static> show()

Makes element visible by setting the visibility attribute

Returns:

this


<static> stop()

Stop any running animations

Returns:

this


<static> text(value)

Set text content of elem

Parameters:
Name Type Description
value string

The value

Returns:

this


<static> trigger()

Trigger an event

Returns:

this


<static> uniqueId()

Get a unique ID for the matched element

Returns:
Type
String

<static> unvirtualize()

Un-virtualizes the element

Returns:
Type
this

<static> value(value)

Set / get value

Parameters:
Name Type Description
value String | Void

The value

Returns:

this


<static> virtualize()

Virtualizes the given element, this essentially takes it out of the DOM and allows you to make modifications to it without forcing DOM updates

This element will not be selectable using DOM queries nor will it be able to use any sort of parent/sibling queries, until unvirtualized.

Returns:
Type
this

<static> visible()

Check if element is visible

Returns:
Type
Boolean