DHTML Methods
Applies an element to another element.
oTarget.applyElement ( oNewElement )
oTarget |
Required. An element that is applied with oNewElement. |
oNewElement |
Required. An element that is applied to oTarget. |
No return value.
The applyElement method applies one element to a target element by making the target a child of the new element.
The following sample demonstrates the use of the applyElement method to apply the I object to an unordered list.
<script language="JavaScript">
function fnApply ( ) {
var oNewNode = document.createElement ( "I" );
oList.applyElement ( oNewNode );
}
</script>
<UL ID = oList>
<LI>List item 1
<LI>List item 2
<LI>List item 3
<LI>List item 4
</UL>
<input type=button value="Apply Element"
onclick="fnApply ( ) ">