W3C DOM tests - miscellaneous attribute functionality

This is the first test element. It has the following attributes, in this order:
id="test"
align="center"
style="border: 1px solid #3B5F9B"
onclick="alert('Clicked!')"
ppk="JavaScript"

This is the second test element. It has only one attribute:
id="test2"

This page contains test cases for miscellaneous attribute functionality.

Other attribute tests:

Test scripts

hasAttribute()

x has all these attributes except for class.

alert(x.hasAttribute('align'))
alert(x.hasAttribute('class'))
alert(x.hasAttribute('ppk'))
alert(x.hasAttribute('onclick'))
alert(x.hasAttribute('style'))

hasAttributes()

alert(x.hasAttributes())

z is the <p> just below this test. It doesn't have attributes.

alert(z.hasAttributes())

Test paragraph without attributes.

specified

alert(x.attributes['onmouseover'].specified)
alert(x.attributes[1].specified)

Microsoft attribute methods

x.clearAttributes()
y.mergeAttributes(x)