DiDom\Element::removeAttribute PHP Method

removeAttribute() public method

Unset an attribute on the element.
public removeAttribute ( string $name ) : Element
$name string The attribute name
return Element
    public function removeAttribute($name)
    {
        $this->node->removeAttribute($name);
        return $this;
    }

Usage Example

Exemplo n.º 1
0
 public function testRemoveAttribute()
 {
     $domElement = $this->createDomElement('input');
     $domElement->setAttribute("value", "test");
     $element = new Element($domElement);
     $this->assertTrue($element->hasAttribute("value"));
     $element->removeAttribute("value");
     $this->assertFalse($element->hasAttribute("value"));
 }
All Usage Examples Of DiDom\Element::removeAttribute