R
Ren
I know that we should not have two Id's that are the same but don't
know how to apply an array.
I want the first button to rotate the first text. I want the second
button to rotate the second text. But I want to use the same function
to do it.
<html>
<title>A Multiple Text Rotater</title>
<head>
<script>
function changeText()
{
oldHTML = document.getElementById('para').innerHTML ;
newHTML = "<b style='-moz-transform:rotate(90deg)'>" + oldHTML +
"</b>" ;
document.getElementById('para').innerHTML = newHTML ;
}
</script>
</head>
<body bgcolor= grey>
<input onClick = changeText() type = button><b id = para>Rotate this
text.</b>
<p>
<input onClick = changeText() type = button><b id = para>Rotate this
other text.</b>
</body>
</html>
know how to apply an array.
I want the first button to rotate the first text. I want the second
button to rotate the second text. But I want to use the same function
to do it.
<html>
<title>A Multiple Text Rotater</title>
<head>
<script>
function changeText()
{
oldHTML = document.getElementById('para').innerHTML ;
newHTML = "<b style='-moz-transform:rotate(90deg)'>" + oldHTML +
"</b>" ;
document.getElementById('para').innerHTML = newHTML ;
}
</script>
</head>
<body bgcolor= grey>
<input onClick = changeText() type = button><b id = para>Rotate this
text.</b>
<p>
<input onClick = changeText() type = button><b id = para>Rotate this
other text.</b>
</body>
</html>