Here is my code:<title>Dom demo</title>
<script type="text/javascript">
function changeText()
{
var Temp = document.getEle mentById('first ').innerHTML= 'Second Entry';
document.getEle mentById('secon d').innerHTML= 'First Entry';
document.getEle mentById('Temp' ).value;
}
</script>
</head>
<body>
<div id="first">Firs t Entry</div>
<div id="second">Sec ond Entry</div>
<input type="button" onclick="change Text()" value="Change text of this document">
</body>
</html>
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?
<script type="text/javascript">
function changeText()
{
var Temp = document.getEle mentById('first ').innerHTML= 'Second Entry';
document.getEle mentById('secon d').innerHTML= 'First Entry';
document.getEle mentById('Temp' ).value;
}
</script>
</head>
<body>
<div id="first">Firs t Entry</div>
<div id="second">Sec ond Entry</div>
<input type="button" onclick="change Text()" value="Change text of this document">
</body>
</html>
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?
Comment