Home >Web Front-end >JS Tutorial >prototype Element study notes (Element Part 3)_prototype
1. Filtering functions
ancestors, recursivelyCollect, descendants, firstDescendant, immediateDescendants, previousSiblings, nextSiblings, siblings, match, up, down, previous, next, select, adjacent.
2. Functions to add, delete and change elements
insert, update, remove, replace, wrap, cleanWhitespace
3. Functions to set various attributes of elements
visible, toggle, hidden, show, identify, readAttribute, writeAttribute, makeClipping, undoClipping
4. Style processing class functions
classNames, hasClassName, addClassName, removeClassName, toggleClassName, getStyle , setStyle, getOpacity, setOpacity.
5. Position processing functions
GetHeight, getWidth, scrollTo, getDimensions, makePositioned, undoPositioned, cumulativeOffset, positionedOffset, absolutize, relativize, cumulativeScrollOffset, getOffsetParent, viewportOffset, clonePosition.
6. Several functions that return Boolean type
empty, descendantOf, visible
7. Event management class
fire, observe, stopObserving
8. static function
extend
Basically these are the categories. However, regarding the position function, it can only be retrieved but not set, so the function is not perfect. The usage documentation for the search function here is not exhaustive. The key is how to write the selector.