public class Element extends Node
Element
.org.htmlunit.corejs.javascript.ScriptableObject.KeyComparator
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
NOT_FOUND
Constructor and Description |
---|
Element() |
Modifier and Type | Method and Description |
---|---|
static void |
after(org.htmlunit.corejs.javascript.Context context,
org.htmlunit.corejs.javascript.Scriptable scope,
org.htmlunit.corejs.javascript.Scriptable thisObj,
Object[] args,
org.htmlunit.corejs.javascript.Function function)
Inserts a set of Node or DOMString objects in the children list of this ChildNode's parent,
just after this ChildNode.
|
static void |
append(org.htmlunit.corejs.javascript.Context context,
org.htmlunit.corejs.javascript.Scriptable scope,
org.htmlunit.corejs.javascript.Scriptable thisObj,
Object[] args,
org.htmlunit.corejs.javascript.Function function)
Inserts a set of Node objects or string objects after the last child of the Element.
|
static void |
before(org.htmlunit.corejs.javascript.Context context,
org.htmlunit.corejs.javascript.Scriptable scope,
org.htmlunit.corejs.javascript.Scriptable thisObj,
Object[] args,
org.htmlunit.corejs.javascript.Function function)
Inserts a set of Node or DOMString objects in the children list of this ChildNode's parent,
just before this ChildNode.
|
static Element |
closest(org.htmlunit.corejs.javascript.Context context,
org.htmlunit.corejs.javascript.Scriptable scope,
org.htmlunit.corejs.javascript.Scriptable thisObj,
Object[] args,
org.htmlunit.corejs.javascript.Function function) |
protected NamedNodeMap |
createAttributesObject()
Creates the JS object for the property attributes.
|
protected void |
createEventHandler(String eventName,
String attrValue)
Create the event handler function from the attribute value.
|
String |
getAttribute(String attributeName) |
HtmlUnitScriptable |
getAttributeNode(String name)
Retrieves an attribute node by name.
|
HtmlUnitScriptable |
getAttributeNodeNS(String namespaceURI,
String localName)
Returns the specified attribute.
|
String |
getAttributeNS(String namespaceURI,
String localName)
Gets the specified attribute.
|
NamedNodeMap |
getAttributes()
Returns the attributes of this XML element.
|
ClientRect |
getBoundingClientRect()
Retrieves an object that specifies the bounds of a collection of TextRectangle objects.
|
int |
getChildElementCount()
Returns the current number of child elements.
|
HTMLCollection |
getChildren()
Gets the children of the current node.
|
DOMTokenList |
getClassList()
Gets the token list of class attribute.
|
String |
getClassName_js()
Returns the class defined for this element.
|
int |
getClientHeight()
Returns the
clientHeight attribute. |
int |
getClientLeft()
Returns the
clientLeft attribute. |
ClientRectList |
getClientRects()
Retrieves a collection of rectangles that describes the layout of the contents of an object
or range within the client.
|
int |
getClientTop()
Returns
clientTop attribute. |
int |
getClientWidth()
Returns the
clientWidth attribute. |
DomElement |
getDomNodeOrDie()
Returns the DOM node that corresponds to this JavaScript object or throw
an exception if one cannot be found.
|
HTMLCollection |
getElementsByClassName(String className)
Returns all the descendant elements with the specified class.
|
HTMLCollection |
getElementsByTagName(String tagName)
Returns all the descendant elements with the specified tag name.
|
HTMLCollection |
getElementsByTagNameNS(Object namespaceURI,
String localName)
Returns a list of elements with the given tag name belonging to the given namespace.
|
Element |
getFirstElementChild()
Returns the first element child.
|
String |
getHTML()
The
getHTML function. |
String |
getId()
Returns the element ID.
|
String |
getInnerHTML()
Gets the
innerHTML attribute. |
protected String |
getInnerHTML(DomNode domNode)
Helper for getInnerHtml (to be reuses bei HTMLTemplate.
|
Element |
getLastElementChild()
Returns the last element child.
|
String |
getLocalName()
Returns the local name of this attribute.
|
String |
getNamespaceURI()
Returns the URI that identifies an XML namespace.
|
Element |
getNextElementSibling()
Returns the next element sibling.
|
org.htmlunit.corejs.javascript.Function |
getOnbeforecopy()
Returns the
onbeforecopy event handler for this element. |
org.htmlunit.corejs.javascript.Function |
getOnbeforecut()
Returns the
onbeforecut event handler for this element. |
org.htmlunit.corejs.javascript.Function |
getOnbeforepaste()
Returns the
onbeforepaste event handler for this element. |
org.htmlunit.corejs.javascript.Function |
getOnsearch()
Returns the
onsearch event handler for this element. |
org.htmlunit.corejs.javascript.Function |
getOnwebkitfullscreenchange()
Returns the
onwebkitfullscreenchange event handler for this element. |
org.htmlunit.corejs.javascript.Function |
getOnwebkitfullscreenerror()
Returns the
onwebkitfullscreenerror event handler for this element. |
org.htmlunit.corejs.javascript.Function |
getOnwheel()
Returns the
onwheel event handler for this element. |
String |
getOuterHTML()
Gets the outerHTML of the node.
|
Element |
getParentElement()
Gets the first ancestor instance of
Element . |
String |
getPrefix()
Returns the namespace prefix.
|
Element |
getPreviousElementSibling()
Returns the previous element sibling.
|
int |
getScrollHeight()
Gets the scrollHeight for this element.
|
int |
getScrollLeft()
Gets the scrollLeft value for this element.
|
int |
getScrollTop()
Gets the scrollTop value for this element.
|
int |
getScrollWidth()
Gets the scrollWidth for this element.
|
protected CSSStyleDeclaration |
getStyle()
Returns the style object for this element.
|
String |
getTagName()
Returns the tag name of this element.
|
boolean |
hasAttribute(String name)
Returns true when an attribute with a given name is specified on this element or has a default value.
|
boolean |
hasAttributeNS(String namespaceURI,
String localName)
Test for attribute.
|
boolean |
hasAttributes()
Returns true when the current element has any attributes or not.
|
Node |
insertAdjacentElement(String where,
Object insertedElement)
Inserts the given element into the element at the location.
|
void |
insertAdjacentHTML(String position,
String text)
Parses the given text as HTML or XML and inserts the resulting nodes into the tree in the position given by the
position argument.
|
void |
insertAdjacentText(String where,
String text)
Inserts the given text into the element at the specified location.
|
protected boolean |
isDisplayNone()
Returns whether the
display is none or not. |
protected boolean |
isEndTagForbidden()
Returns whether the end tag is forbidden or not.
|
void |
jsConstructor()
JavaScript constructor.
|
static boolean |
matches(org.htmlunit.corejs.javascript.Context context,
org.htmlunit.corejs.javascript.Scriptable scope,
org.htmlunit.corejs.javascript.Scriptable thisObj,
Object[] args,
org.htmlunit.corejs.javascript.Function function)
Returns true if the element would be selected by the specified selector string; otherwise, returns false.
|
static boolean |
mozMatchesSelector(org.htmlunit.corejs.javascript.Context context,
org.htmlunit.corejs.javascript.Scriptable scope,
org.htmlunit.corejs.javascript.Scriptable thisObj,
Object[] args,
org.htmlunit.corejs.javascript.Function function)
Returns true if the element would be selected by the specified selector string; otherwise, returns false.
|
static void |
prepend(org.htmlunit.corejs.javascript.Context context,
org.htmlunit.corejs.javascript.Scriptable scope,
org.htmlunit.corejs.javascript.Scriptable thisObj,
Object[] args,
org.htmlunit.corejs.javascript.Function function)
Inserts a set of Node objects or string objects before the first child of the Element.
|
protected void |
printChildren(StringBuilder builder,
DomNode node,
boolean html)
Helper for getting code back from nodes.
|
protected void |
printNode(StringBuilder builder,
DomNode node,
boolean html) |
Node |
querySelector(String selectors)
Returns the first element within the document that matches the specified group of selectors.
|
NodeList |
querySelectorAll(String selectors)
Retrieves all element nodes from descendants of the starting element node that match any selector
within the supplied selector strings.
|
void |
releaseCapture()
Mock for the moment.
|
void |
remove()
Removes the DOM node from its parent.
|
void |
removeAttribute(String name)
Removes the specified attribute.
|
void |
removeAttributeNode(Attr attribute)
Removes the specified attribute.
|
void |
removeAttributeNS(String namespaceURI,
String localName)
Removes the specified attribute.
|
static void |
replaceChildren(org.htmlunit.corejs.javascript.Context context,
org.htmlunit.corejs.javascript.Scriptable scope,
org.htmlunit.corejs.javascript.Scriptable thisObj,
Object[] args,
org.htmlunit.corejs.javascript.Function function)
Replaces the existing children of a Node with a specified new set of children.
|
static void |
replaceWith(org.htmlunit.corejs.javascript.Context context,
org.htmlunit.corejs.javascript.Scriptable scope,
org.htmlunit.corejs.javascript.Scriptable thisObj,
Object[] args,
org.htmlunit.corejs.javascript.Function function)
Replaces the node with a set of Node or DOMString objects.
|
void |
scroll(org.htmlunit.corejs.javascript.Scriptable x,
org.htmlunit.corejs.javascript.Scriptable y)
Scrolls to a particular set of coordinates inside a given element.
|
void |
scrollBy(org.htmlunit.corejs.javascript.Scriptable x,
org.htmlunit.corejs.javascript.Scriptable y)
Scrolls the element by the given amount.
|
void |
scrollIntoView()
Implement the
scrollIntoView() JavaScript function but don't actually do
anything. |
void |
scrollIntoViewIfNeeded()
Implement the
scrollIntoViewIfNeeded() JavaScript function but don't actually do
anything. |
void |
scrollTo(org.htmlunit.corejs.javascript.Scriptable x,
org.htmlunit.corejs.javascript.Scriptable y)
Scrolls to a particular set of coordinates inside a given element.
|
void |
setAttribute(String name,
String value)
Sets an attribute.
|
Attr |
setAttributeNode(Attr newAtt)
Sets the attribute node for the specified attribute.
|
void |
setAttributeNS(String namespaceURI,
String qualifiedName,
String value)
Sets the specified attribute.
|
void |
setCapture(boolean retargetToElement)
Mock for the moment.
|
void |
setClassName_js(String className)
Sets the class attribute for this element.
|
void |
setDomNode(DomNode domNode)
Sets the DOM node that corresponds to this JavaScript object.
|
void |
setId(String newId)
Sets the id value for this element.
|
void |
setInnerHTML(Object value)
Replaces all child elements of this element with the supplied value.
|
void |
setOnbeforecopy(Object onbeforecopy)
Sets the
onbeforecopy event handler for this element. |
void |
setOnbeforecut(Object onbeforecut)
Sets the
onbeforecut event handler for this element. |
void |
setOnbeforepaste(Object onbeforepaste)
Sets the
onbeforepaste event handler for this element. |
void |
setOnsearch(Object onsearch)
Sets the
onsearch event handler for this element. |
void |
setOnwebkitfullscreenchange(Object onwebkitfullscreenchange)
Sets the
onwebkitfullscreenchange event handler for this element. |
void |
setOnwebkitfullscreenerror(Object onwebkitfullscreenerror)
Sets the
onwebkitfullscreenerror event handler for this element. |
void |
setOnwheel(Object onwheel)
Sets the
onwheel event handler for this element. |
void |
setOuterHTML(Object value)
Replaces this element (including all child elements) with the supplied value.
|
void |
setScrollLeft(int scroll)
Sets the scrollLeft value for this element.
|
void |
setScrollTop(int scroll)
Sets the scrollTop value for this element.
|
protected void |
setStyle(String style)
Sets the styles for this element.
|
boolean |
toggleAttribute(String name,
Object force)
The
toggleAttribute() method of the Element interface toggles a
Boolean attribute (removing it if it is present and adding it if it is not
present) on the given element. |
static boolean |
webkitMatchesSelector(org.htmlunit.corejs.javascript.Context context,
org.htmlunit.corejs.javascript.Scriptable scope,
org.htmlunit.corejs.javascript.Scriptable thisObj,
Object[] args,
org.htmlunit.corejs.javascript.Function function)
Returns true if the element would be selected by the specified selector string; otherwise, returns false.
|
after, append, appendChild, before, cloneNode, compareDocumentPosition, contains, getBaseURI, getChildNodes, getFirstChild, getJavaScriptNode, getLastChild, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParent, getParentNode, getPreviousSibling, getRootNode, getTextContent, hasChildNodes, insertBefore, insertBeforeImpl, isEqualNode, isSameNode, lookupPrefix, normalize, prepend, removeChild, replaceChild, replaceChildren, replaceWith, setNodeValue, setTextContent
addEventListener, clearEventListenersContainer, dispatchEvent, executeEventLocally, fireEvent, getEventHandler, getEventListenersContainer, hasEventHandlers, isEventHandlerOnWindow, removeEventListener, setEventHandler
clone, equivalentValues, get, getBrowserVersion, getClassName, getDefaultValue, getDomNodeOrNull, getPrototype, getScriptableFor, getWindow, getWindow, getWindowFromTopCallScope, getWithPreemption, has, hasInstance, initParentScope, makeScriptableFor, put, setClassName, setDomNode, setParentScope, setupPromise, setupRejectedPromise
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, delete, deleteProperty, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureSymbolScriptable, get, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, has, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, put, putConst, putConstProperty, putProperty, putProperty, putProperty, querySlot, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setAttributes, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setPrototype, size
public void jsConstructor()
jsConstructor
in class Node
public void setDomNode(DomNode domNode)
setDomNode
in class HtmlUnitScriptable
domNode
- the DOM nodeprotected void createEventHandler(String eventName, String attrValue)
eventName
- the event name (ex: "onclick")attrValue
- the attribute valuepublic String getTagName()
public NamedNodeMap getAttributes()
getAttributes
in class Node
protected NamedNodeMap createAttributesObject()
public String getAttribute(String attributeName)
attributeName
- attribute namenull
if the attribute is not definedpublic void setAttribute(String name, String value)
name
- Name of the attribute to setvalue
- Value to set the attribute topublic HTMLCollection getElementsByTagName(String tagName)
tagName
- the name to search forpublic HtmlUnitScriptable getAttributeNode(String name)
name
- the name of the attribute to retrievenull
if there is no such attributepublic HTMLCollection getElementsByTagNameNS(Object namespaceURI, String localName)
namespaceURI
- the namespace URI of elements to look forlocalName
- is either the local name of elements to look for or the special value "*",
which matches all elements.public boolean hasAttribute(String name)
name
- the name of the attribute to look forpublic boolean hasAttributes()
hasAttributes
in class Node
public DomElement getDomNodeOrDie()
getDomNodeOrDie
in class HtmlUnitScriptable
public void removeAttribute(String name)
name
- the name of the attribute to removepublic ClientRect getBoundingClientRect()
public int getChildElementCount()
getChildElementCount
in class Node
public Element getFirstElementChild()
getFirstElementChild
in class Node
public Element getLastElementChild()
getLastElementChild
in class Node
public Element getNextElementSibling()
public Element getPreviousElementSibling()
public Element getParentElement()
Element
. It is mostly identical
to Node.getParent()
except that it skips non Element
nodes.getParentElement
in class Node
Node.getParent()
public HTMLCollection getChildren()
getChildren
in class Node
public DOMTokenList getClassList()
public String getAttributeNS(String namespaceURI, String localName)
namespaceURI
- the namespace URIlocalName
- the local name of the attribute to look fornull
if the attribute is not definedpublic boolean hasAttributeNS(String namespaceURI, String localName)
namespaceURI
- the namespace URIlocalName
- the local name of the attribute to look fortrue
if the node has this attributepublic void setAttributeNS(String namespaceURI, String qualifiedName, String value)
namespaceURI
- the namespace URIqualifiedName
- the qualified name of the attribute to look forvalue
- the new attribute valuepublic void removeAttributeNS(String namespaceURI, String localName)
namespaceURI
- the namespace URI of the attribute to removelocalName
- the local name of the attribute to removepublic Attr setAttributeNode(Attr newAtt)
newAtt
- the attribute to setpublic NodeList querySelectorAll(String selectors)
selectors
- the selectorspublic Node querySelector(String selectors)
selectors
- the selectorspublic String getClassName_js()
public void setClassName_js(String className)
className
- the new class namepublic int getClientHeight()
clientHeight
attribute.clientHeight
attributepublic int getClientWidth()
clientWidth
attribute.clientWidth
attributepublic int getClientLeft()
clientLeft
attribute.clientLeft
attributepublic int getClientTop()
clientTop
attribute.clientTop
attributepublic HtmlUnitScriptable getAttributeNodeNS(String namespaceURI, String localName)
namespaceURI
- the namespace URIlocalName
- the local name of the attribute to look fornull
if the attribute is not definedpublic HTMLCollection getElementsByClassName(String className)
className
- the name to search forpublic ClientRectList getClientRects()
protected final boolean isDisplayNone()
display
is none
or not.display
is none
or notpublic Node insertAdjacentElement(String where, Object insertedElement)
where
- specifies where to insert the element, using one of the following values (case-insensitive):
beforebegin, afterbegin, beforeend, afterendinsertedElement
- the element to be insertedpublic void insertAdjacentText(String where, String text)
where
- specifies where to insert the text, using one of the following values (case-insensitive):
beforebegin, afterbegin, beforeend, afterendtext
- the text to insertpublic void insertAdjacentHTML(String position, String text)
position
- specifies where to insert the nodes, using one of the following values (case-insensitive):
beforebegin
, afterbegin
, beforeend
, afterend
text
- the text to parsepublic String getHTML()
getHTML
function.public String getInnerHTML()
innerHTML
attribute.public void setInnerHTML(Object value)
value
- the new value for the contents of this elementprotected String getInnerHTML(DomNode domNode)
domNode
- the nodepublic String getOuterHTML()
public void setOuterHTML(Object value)
value
- the new value for replacing this elementprotected final void printChildren(StringBuilder builder, DomNode node, boolean html)
builder
- the builder to write tonode
- the node to be serializedhtml
- flagprotected void printNode(StringBuilder builder, DomNode node, boolean html)
protected boolean isEndTagForbidden()
public String getId()
public void setId(String newId)
newId
- the newId value for this elementpublic void removeAttributeNode(Attr attribute)
attribute
- the attribute to removepublic int getScrollTop()
public void setScrollTop(int scroll)
scroll
- the scrollTop value for this elementpublic int getScrollLeft()
public void setScrollLeft(int scroll)
scroll
- the scrollLeft value for this elementpublic int getScrollHeight()
public int getScrollWidth()
protected CSSStyleDeclaration getStyle()
protected void setStyle(String style)
style
- the style of the elementpublic void scroll(org.htmlunit.corejs.javascript.Scriptable x, org.htmlunit.corejs.javascript.Scriptable y)
x
- the horizontal pixel value that you want to scroll toy
- the vertical pixel value that you want to scroll topublic void scrollBy(org.htmlunit.corejs.javascript.Scriptable x, org.htmlunit.corejs.javascript.Scriptable y)
x
- the horizontal pixel value that you want to scroll byy
- the vertical pixel value that you want to scroll bypublic void scrollTo(org.htmlunit.corejs.javascript.Scriptable x, org.htmlunit.corejs.javascript.Scriptable y)
x
- the horizontal pixel value that you want to scroll toy
- the vertical pixel value that you want to scroll topublic void scrollIntoView()
scrollIntoView()
JavaScript function but don't actually do
anything. The requirement
is just to prevent scripts that call that method from failingpublic void scrollIntoViewIfNeeded()
scrollIntoViewIfNeeded()
JavaScript function but don't actually do
anything.public String getPrefix()
public String getLocalName()
getLocalName
in class Node
public String getNamespaceURI()
getNamespaceURI
in class Node
public org.htmlunit.corejs.javascript.Function getOnbeforecopy()
onbeforecopy
event handler for this element.onbeforecopy
event handler for this elementpublic void setOnbeforecopy(Object onbeforecopy)
onbeforecopy
event handler for this element.onbeforecopy
- the onbeforecopy
event handler for this elementpublic org.htmlunit.corejs.javascript.Function getOnbeforecut()
onbeforecut
event handler for this element.onbeforecut
event handler for this elementpublic void setOnbeforecut(Object onbeforecut)
onbeforecut
event handler for this element.onbeforecut
- the onbeforecut
event handler for this elementpublic org.htmlunit.corejs.javascript.Function getOnbeforepaste()
onbeforepaste
event handler for this element.onbeforepaste
event handler for this elementpublic void setOnbeforepaste(Object onbeforepaste)
onbeforepaste
event handler for this element.onbeforepaste
- the onbeforepaste
event handler for this elementpublic org.htmlunit.corejs.javascript.Function getOnsearch()
onsearch
event handler for this element.onsearch
event handler for this elementpublic void setOnsearch(Object onsearch)
onsearch
event handler for this element.onsearch
- the onsearch
event handler for this elementpublic org.htmlunit.corejs.javascript.Function getOnwebkitfullscreenchange()
onwebkitfullscreenchange
event handler for this element.onwebkitfullscreenchange
event handler for this elementpublic void setOnwebkitfullscreenchange(Object onwebkitfullscreenchange)
onwebkitfullscreenchange
event handler for this element.onwebkitfullscreenchange
- the onwebkitfullscreenchange
event handler for this elementpublic org.htmlunit.corejs.javascript.Function getOnwebkitfullscreenerror()
onwebkitfullscreenerror
event handler for this element.onwebkitfullscreenerror
event handler for this elementpublic void setOnwebkitfullscreenerror(Object onwebkitfullscreenerror)
onwebkitfullscreenerror
event handler for this element.onwebkitfullscreenerror
- the onwebkitfullscreenerror
event handler for this elementpublic org.htmlunit.corejs.javascript.Function getOnwheel()
onwheel
event handler for this element.onwheel
event handler for this elementpublic void setOnwheel(Object onwheel)
onwheel
event handler for this element.onwheel
- the onwheel
event handler for this elementpublic void remove()
remove
in class Node
public void setCapture(boolean retargetToElement)
retargetToElement
- if true, all events are targeted directly to this element;
if false, events can also fire at descendants of this elementpublic void releaseCapture()
public static void before(org.htmlunit.corejs.javascript.Context context, org.htmlunit.corejs.javascript.Scriptable scope, org.htmlunit.corejs.javascript.Scriptable thisObj, Object[] args, org.htmlunit.corejs.javascript.Function function)
context
- the contextscope
- the scopethisObj
- this objectargs
- the argumentsfunction
- the functionpublic static void after(org.htmlunit.corejs.javascript.Context context, org.htmlunit.corejs.javascript.Scriptable scope, org.htmlunit.corejs.javascript.Scriptable thisObj, Object[] args, org.htmlunit.corejs.javascript.Function function)
context
- the contextscope
- the scopethisObj
- this objectargs
- the argumentsfunction
- the functionpublic static void replaceWith(org.htmlunit.corejs.javascript.Context context, org.htmlunit.corejs.javascript.Scriptable scope, org.htmlunit.corejs.javascript.Scriptable thisObj, Object[] args, org.htmlunit.corejs.javascript.Function function)
context
- the contextscope
- the scopethisObj
- this objectargs
- the argumentsfunction
- the functionpublic static boolean matches(org.htmlunit.corejs.javascript.Context context, org.htmlunit.corejs.javascript.Scriptable scope, org.htmlunit.corejs.javascript.Scriptable thisObj, Object[] args, org.htmlunit.corejs.javascript.Function function)
context
- the JavaScript contextscope
- the scopethisObj
- the scriptableargs
- the arguments passed into the methodfunction
- the functionpublic static boolean mozMatchesSelector(org.htmlunit.corejs.javascript.Context context, org.htmlunit.corejs.javascript.Scriptable scope, org.htmlunit.corejs.javascript.Scriptable thisObj, Object[] args, org.htmlunit.corejs.javascript.Function function)
context
- the JavaScript contextscope
- the scopethisObj
- the scriptableargs
- the arguments passed into the methodfunction
- the functionpublic static boolean webkitMatchesSelector(org.htmlunit.corejs.javascript.Context context, org.htmlunit.corejs.javascript.Scriptable scope, org.htmlunit.corejs.javascript.Scriptable thisObj, Object[] args, org.htmlunit.corejs.javascript.Function function)
context
- the JavaScript contextscope
- the scopethisObj
- the scriptableargs
- the arguments passed into the methodfunction
- the functionpublic static Element closest(org.htmlunit.corejs.javascript.Context context, org.htmlunit.corejs.javascript.Scriptable scope, org.htmlunit.corejs.javascript.Scriptable thisObj, Object[] args, org.htmlunit.corejs.javascript.Function function)
public boolean toggleAttribute(String name, Object force)
toggleAttribute()
method of the Element interface toggles a
Boolean attribute (removing it if it is present and adding it if it is not
present) on the given element. If force
is true
, adds
boolean attribute with name
. If force
is false
,
removes attribute with name
.name
- the name of the attribute to be toggled.
The attribute name is automatically converted to all lower-case when toggleAttribute()
is called on an HTML element in an HTML document.force
- if true, the toggleAttribute method adds an attribute named namepublic static void append(org.htmlunit.corejs.javascript.Context context, org.htmlunit.corejs.javascript.Scriptable scope, org.htmlunit.corejs.javascript.Scriptable thisObj, Object[] args, org.htmlunit.corejs.javascript.Function function)
context
- the contextscope
- the scopethisObj
- this objectargs
- the argumentsfunction
- the functionpublic static void prepend(org.htmlunit.corejs.javascript.Context context, org.htmlunit.corejs.javascript.Scriptable scope, org.htmlunit.corejs.javascript.Scriptable thisObj, Object[] args, org.htmlunit.corejs.javascript.Function function)
context
- the contextscope
- the scopethisObj
- this objectargs
- the argumentsfunction
- the functionpublic static void replaceChildren(org.htmlunit.corejs.javascript.Context context, org.htmlunit.corejs.javascript.Scriptable scope, org.htmlunit.corejs.javascript.Scriptable thisObj, Object[] args, org.htmlunit.corejs.javascript.Function function)
context
- the contextscope
- the scopethisObj
- this objectargs
- the argumentsfunction
- the functionCopyright © 2002–2024 Gargoyle Software Inc.. All rights reserved.