Unset an attribute on the element.
public removeAttribute ( string $name ) : |
||
$name | string | The attribute name |
리턴 |
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")); }
public function testRemoveAttribute() { $element = new Element('input', null, ['name' => 'username']); $this->assertTrue($element->hasAttribute('name')); $element->removeAttribute('name'); $this->assertFalse($element->hasAttribute('name')); }
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')); }