removeAttribute() public method

Unset an attribute on the element.
public removeAttribute ( string $name ) : Element
$name string The attribute name
return Element
コード例 #1
0
ファイル: ElementTest.php プロジェクト: nik4152/DiDOM
 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"));
 }
コード例 #2
0
ファイル: ElementTest.php プロジェクト: imangazaliev/didom
 public function testRemoveAttribute()
 {
     $element = new Element('input', null, ['name' => 'username']);
     $this->assertTrue($element->hasAttribute('name'));
     $element->removeAttribute('name');
     $this->assertFalse($element->hasAttribute('name'));
 }
コード例 #3
0
ファイル: ElementTest.php プロジェクト: ixtel/DiDOM
 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'));
 }