Class Attr

All Implemented Interfaces:
Serializable, Cloneable, org.htmlunit.corejs.javascript.ConstProperties, org.htmlunit.corejs.javascript.debug.DebuggableObject, org.htmlunit.corejs.javascript.Scriptable, org.htmlunit.corejs.javascript.SymbolScriptable

public class Attr extends Node
A JavaScript object for Attr.
See Also:
  • Constructor Details

    • Attr

      public Attr()
      Creates an instance.
  • Method Details

    • jsConstructor

      public void jsConstructor()
      JavaScript constructor.
      Overrides:
      jsConstructor in class Node
    • detachFromParent

      public void detachFromParent()
      Detaches this attribute from the parent HTML element after caching the attribute value.
    • getName

      public String getName()
      Returns the name of the attribute.
      Returns:
      the name of the attribute
    • getNodeValue

      public String getNodeValue()
      Returns the value of this attribute.
      Overrides:
      getNodeValue in class Node
      Returns:
      the value of this attribute
    • getOwnerElement

      public HtmlUnitScriptable getOwnerElement()
      Returns the owner element.
      Returns:
      the owner element
    • getParentNode

      public Node getParentNode()
      Gets the JavaScript property parentNode for the node that contains the current node.
      Overrides:
      getParentNode in class Node
      Returns:
      null
    • isSpecified

      public boolean isSpecified()
      Returns true if this attribute has been specified.
      Returns:
      true if this attribute has been specified
    • getValue

      public String getValue()
      Returns the value of this attribute.
      Returns:
      the value of this attribute
    • setValue

      public void setValue(String value)
      Sets the value of this attribute.
      Parameters:
      value - the new value of this attribute
    • getFirstChild

      public Node getFirstChild()
      Gets the JavaScript property firstChild for the node that contains the current node.
      Overrides:
      getFirstChild in class Node
      Returns:
      the first child node or null if the current node has no children.
    • getLastChild

      public Node getLastChild()
      Gets the JavaScript property lastChild for the node that contains the current node.
      Overrides:
      getLastChild in class Node
      Returns:
      the last child node or null if the current node has no children.
    • getDomNodeOrDie

      public DomAttr getDomNodeOrDie()
      Returns the DOM node that corresponds to this JavaScript object or throw an exception if one cannot be found.
      Overrides:
      getDomNodeOrDie in class HtmlUnitScriptable
      Returns:
      the DOM node
    • getPrefix

      public Object getPrefix()
      Returns the namespace prefix.
      Overrides:
      getPrefix in class Node
      Returns:
      the namespace prefix
    • getLocalName

      public Object getLocalName()
      Returns the local name of this attribute.
      Overrides:
      getLocalName in class Node
      Returns:
      the local name of this attribute
    • getNamespaceURI

      public Object getNamespaceURI()
      Returns the URI that identifies an XML namespace.
      Overrides:
      getNamespaceURI in class Node
      Returns:
      the URI that identifies an XML namespace
    • getRootNode

      public Object getRootNode()
      Returns the owner document.
      Overrides:
      getRootNode in class Node
      Returns:
      the document