<HEAD>
<SCRIPT>
function replaceElement()
{
//The first child of the div is the bold element.
var oChild=Div1.children(0);
var sInnerHTML = oChild.innerHTML;
if (oChild.tagName=="B")
{
"I");
Div1.replaceChild(oNewChild, oChild);
oNewChild.innerHTML=sInnerHTML
}
else
{
"B");
Div1.replaceChild(oNewChild, oChild);
oNewChild.innerHTML=sInnerHTML
}
}
</SCRIPT>
</HEAD>
<BODY>
<DIV ID=Div1 >
Click anywhere in this sentence to toggle this <B>word</B>
between bold and italic.</DIV>
</BODY>