That function creates additional levels of nested elements each time it is run.
Code:
<html>
<title>Multiple Text Rotator</title>
<head>
<script>
function changeText( id )
{
var rStyle = '-moz-transform: rotate(90deg);',
elem = document.getElementById( id ),
es = elem.style;
if( es.cssText.indexOf( rStyle ) == -1 )
es.cssText += ';' + rStyle;
else
es.cssText = es.cssText.replace( rStyle, "");
}
</script>
</head>
<body bgcolor= '#cccccc'>
<input onclick = changeText('para') type = button><b id = 'para'>Rotate this text.</b>
<p>
<input onclick = changeText('para2') type = button><b id = 'para2'>This will work only on Mozilla.</b>
</body>
</html>
You're welcome in advance.
Bookmarks