This sample uses the mergeAttributes method to copy attributes, styles, and events from one element to another. Click the View outerHTML button to see the HTML source of the second div element. When you click the Merge Attributes button, the attributes, styles, and events set on the first div element are copied to the second div element, and the outerHTML property is displayed. Notice that the id is not copied, but the attribute1 and attribute2 expandos and events are copied. Click the Reset Attributes button to return the attributes on the element to their original state.
[Right-click and choose View Source from the shortcut menu.]
© 2007 Microsoft Corporation. All rights reserved. Terms of use.