Método createAttribute() do XML DOM

Manual de referência do objeto Document

Definição e uso

Criar um novo nó Attr.

Sintaxe:

createAttribute(name)
Parâmetros Descrição
name O nome do atributo recém-criado.

lançar

Se o parâmetro name contiver caracteres ilegais, o método lançará uma exceção com o código INVALID_CHARACTER_ERR Exceção DOMException.

Ver

Element.setAttribute() , Element.setAttributeNode()

Manual de referência do objeto Document