PHPHtmlParser\Dom\AbstractNode::getAttribute PHP Method

getAttribute() public method

A wrapper method that simply calls the getAttribute method on the tag of this node.
public getAttribute ( string $key ) : mixed
$key string
return mixed
    public function getAttribute($key)
    {
        $attribute = $this->tag->getAttribute($key);
        if (!is_null($attribute)) {
            $attribute = $attribute['value'];
        }
        return $attribute;
    }