Javascript [Electronic resources] : The Definitive Guide (4th Edition)

David Flanagan

نسخه متنی -صفحه : 844/ 586
نمايش فراداده

Availability

DOM Level 1 Core

Synopsis

Attr createAttribute(String name) throws DOMException;

Arguments

name

The name for the newly created attribute.

Returns

A newly created Attr node with its nodeName property set to name.

Throws

This method throws a DOMException with a code of INVALID_CHARACTER_ERR if name contains an illegal character.

See Also

Attr, Element.setAttribute( ), Element.setAttributeNode( )