DOMElement::removeAttribute
(PHP 5, PHP 7)
DOMElement::removeAttribute — 属性を削除する
説明
public DOMElement::removeAttribute
( string $name
) : bool
name
という名前の属性を要素から削除します。
パラメータ
name
- 属性の名前。
返り値
成功した場合に true
を、失敗した場合に false
を返します。
エラー / 例外
DOM_NO_MODIFICATION_ALLOWED_ERR
- ノードが読み込み専用の場合に発生します。
参考
- DOMElement::hasAttribute() - 属性が存在するかどうかを調べる
- DOMElement::getAttribute() - 属性の値を返す
- DOMElement::setAttribute() - 新しい属性を追加する