Skip to main content

document_create_attribute

Function document_create_attribute 

Source
pub fn document_create_attribute(
    _it: &mut Interp,
    _this: Value,
    a: &[Value],
) -> Result<Value, Value>
Expand description

document.createAttribute(name)(丸ごと未対応だった。getAttributeNode と対になる、Attr ノードを新規に作ってから setAttributeNode() で 要素へ取り付ける定番パターン)。HTML 文書のため仕様どおり名前を 小文字化し、値は空文字列・ownerElementnull(未取り付け)で返す。