ren1999
05-03-2010, 04:47 AM
First, many thanks in advance for any help I will receive. You are coding gods.
I have seen the same functions used for multiple values using this.index setThisText = _setThisText, etc. However, I can't understand how to apply this to the script below.
I would like the first button to rotate the following text. I would then like the second button to rotate the text after that.
I do not want to have multiple functions that do the same thing.
<html>
<title>Ren's 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>
I have seen the same functions used for multiple values using this.index setThisText = _setThisText, etc. However, I can't understand how to apply this to the script below.
I would like the first button to rotate the following text. I would then like the second button to rotate the text after that.
I do not want to have multiple functions that do the same thing.
<html>
<title>Ren's 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>