December 23, 2000 - Creating New Attributes | WebReference

December 23, 2000 - Creating New Attributes

Yehuda Shiran December 23, 2000
Creating New Attributes
Tips: December 2000

Yehuda Shiran, Ph.D.
Doc JavaScript

The DOM on Netscape 6 lets you create attributes on the fly. You would go:

document.createAttribute("foo");

for example, and out you will get a new attribute object. The value of the attribute is an empty string. Its name will be "foo" in this example.

The code in this tip can be viewed only by Netscape 6.

Learn more about the DOM in Columns 40, The DOM, Part I: Analysis, through Column 47, A DOM-Based Snakes Game, Part II.