Here is my code:<title>Dom demo</title>
It displays:
First Entry
Second Entry
I press a radio button that makes it do this
Second Entry
First Entry
But I don't know how to make it go back to :
First Entry
Second Entry:
I am knew to this stuff can someone help?
reply
Code:
<script type="text/javascript">
function changeText()
{
var Temp = document.getElementById('first').innerHTML= 'Second Entry';
document.getElementById('second').innerHTML= 'First Entry';
document.getElementById('Temp').value;
}
</script>
</head>
<body>
<div id="first">First Entry</div>
<div id="second">Second Entry</div>
<input type="button" onclick="changeText()" value="Change text of this document">
</body>
</html>
First Entry
Second Entry
I press a radio button that makes it do this
Second Entry
First Entry
But I don't know how to make it go back to :
First Entry
Second Entry:
I am knew to this stuff can someone help?
reply
Comment