removeAttribute() public method

Unset an attribute on the element.
public removeAttribute ( string $name ) : Element
$name string The attribute name
return Element
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"));
 }
Exemplo n.º 2
0
 public function testRemoveAttribute()
 {
     $element = new Element('input', null, ['name' => 'username']);
     $this->assertTrue($element->hasAttribute('name'));
     $element->removeAttribute('name');
     $this->assertFalse($element->hasAttribute('name'));
 }
Exemplo n.º 3
0
 public function testRemoveAttribute()
 {
     $node = $this->createNode('input');
     $node->setAttribute('value', 'test');
     $element = new Element($node);
     $this->assertTrue($element->hasAttribute('value'));
     $element->removeAttribute('value');
     $this->assertFalse($element->hasAttribute('value'));
 }