/

HTML / CSS / JavaScript Tutorial

JavaScript Document own method: createAttribute()

[this page | pdf | back links]

The createAttribute() method (when applied to the document object of the JavaScript DOM) creates an attribute node.

 

It has the following syntax with the following parameters. It returns a node object represents the created attribute.

 

document.createAttribute(attributename)

 

Parameter

Required / Optional

Description

attributename

Required

An Attr object which is the name of the attribute to create

 


NAVIGATION LINKS
Contents | Prev | Next | JavaScript DOM (and BOM)


Desktop view | Switch to Mobile