src/PHPHtmlParser/Dom/AbstractNode.php
public function setAttribute(string $key, $value): AbstractNode
    {
        $this->tag->setAttribute($key, $value);

        //clear any cache
        $this->clear();

        return $this;
    }
public function setAttribute(string $key, $value): AbstractNode
    {
        $this->tag->setAttribute($key, $value);

        //clear any cache
        $this->clear();

        return $this;
    }
public function setAttribute ( string $ key , $ value ) : AbstractNode { $ this -> tag -> setAttribute ( $ key , $ value ) ; //clear any cache $ this -> clear ( ) ; return $ this ; }
A wrapper method that simply calls the setAttribute method
on the tag of this node.

@param string $key
@param string|null $value
@return AbstractNode
@chainable
A wrapper method that simply calls the setAttribute method on the tag of this node .