Jquery

Jquery

  • Docs

Manipulation

.val( value )

Set the given value of the all elements in the set of matched elements.

    $(selector).val(value)

.val()

Get the current value of the first element in the set of matched elements.

    $(selector).val()

.attr( attr, value )

Set the value of an attribute for the all elements in the set of matched elements.

    $(selector).attr(attr,value)

.attr( attr )

Get the value of an attribute for the first element in the set of matched elements.

    $(selector).attr(attr)

.text( text )

Set the text contents of the all elements in the set of matched elements.

    $(selector).text(text)

.text()

Get the text contents of the first element in the set of matched elements.

    $(selector).text()

.html( html )

Set the html contents of the all elements in the set of matched elements.

    $(selector).html(html)

.html()

Get the html contents of the first element in the set of matched elements.

    $(selector).html()

.removeAttr( attr )

Remove an attribute from each element in the set of matched elements.

    $(selector).removeAttr(attr)

.append( element )

Insert content, specified by the parameter, to the end of each element in the set of matched elements.

    $(selector).append(element)

.appendTo( element )

Insert every element in the set of matched elements to the end of the target.

    $(selector).appendTo(element)

.after( element )

Insert content, specified by the parameter, after each element in the set of matched elements.

    $(selector).after(element)

.before( element )

Insert content, specified by the parameter, before each element in the set of matched elements.

    $(selector).before(element)

.prepend( element )

Insert content, specified by the parameter, to the beginning of each element in the set of matched elements.

    $(selector).prepend(element)

.clone()

Create a deep copy of the set of matched elements.

    $(selector).clone()

.empty()

Remove all child nodes and text content of the set of matched elements from the DOM.

    $(selector).empty()

.remove()

Remove the set of matched elements from the DOM.

    $(selector).remove()

.index()

Get the index of the first element in the set of matched elements.

return as integer

    $(selector).index()
Facebook Open Source
Copyright © 2018 TESODEV