Home  >  Article  >  Web Front-end  >  Summary of angular.element methods_AngularJS

Summary of angular.element methods_AngularJS

WBOY
WBOYOriginal
2016-05-16 16:21:431129browse

addClass()-Adds the specified style class name to each matching element
after()-Insert the content specified by the parameter after each element in the matching element set as its sibling node
append()-Insert parameter content
at the end of each matching element attr() - Gets the value of the attribute of the first element in the matched element set
bind() - Bind an event handler to an element
children() - Get the child elements of each element in the matching element set, and the selector selectively filters
clone()-Create a deep copy of the matching set of elements
contents() - Gets the child elements of each element in the matching element set, including text and comment nodes
css() - Gets the value of the style attribute of the first element in the set of matched elements
data() - stores any relevant data on the matched element
detach()-Remove all matching elements from the DOM
empty()-Removes all child nodes of matching elements in the collection from the DOM
eq()-Reduce the set of matching elements to which element of the specified index
find() - Get the descendants of each element in the currently matched element set through a selector, jQuery object, or element filter
hasClass() - determines whether any matching element has the given (style) class assigned
html() - Get the HTML content of the first matching element in the collection
next() - Gets the set of elements immediately following the sibling elements of each element in the matched set of elements. If a selector is provided, this element will be returned only if the following sibling element satisfies the selector
on() - Bind one or more event handlers to the selected element
off() - Remove an event handler
one() - Adds a handler for an element's event. The handler function is executed at most once per event type on each element
parent() - Gets the parent element of each element in the set of matching elements. You can provide an optional selector
prepend()-Insert the parameter content in front of each matching element (inside the element)
prop()-Get the property value of the first element in the matched element set
ready() - specifies a function to execute when the DOM is ready
remove()-Removes the set of matching elements from the DOM. (Also removes events and jQuery data on the element.)
removeAttr()-Removes an attribute from each element in the matched element set
removeClass()-Remove one, multiple or all styles on each matching element in the collection
removeData()-Removes bound data on an element
replaceWith() - Replaces all matching elements in the collection with the provided content and returns the collection of deleted elements
text() - Get the merged text of each element in the set of matching elements, including their descendants
toggleClass() - Adds or removes one or more style classes from each element in the matched set of elements, depending on whether this style class exists or the value of the toggle attribute. That is: delete (add) a class if it exists (does not exist)
triggerHandler() - Execute all handlers attached to an element for an event
unbind() - removes a previously attached event handler from an element
val()-gets the current value of the first element in the matched element set
wrap()-wrap an html element

around each matching element
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn