I am learning javascript and started working with using scripts to modify the DOM.
I have a small html file where the user pushes a button and the html changes state. What I am having trouble with is, after the main onclick event, having the same button reset the page to it's original state, i.e. editing the DOM to return to its original mark-up.
This is my file (I know it's simple but it will help me):
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>My First JavaScript</title>
<style type="text/css">
h3#norm {
font-size: 1.5em;
color: #000;
}
h3 {
font-size: 2em;
color: #0059D7;
}
</style>
</head>
<body>
<!--creating a wrapper to contain and layout the page-->
<div id="wrapper">
<h3 id="norm">Are you new here?</h3>
<!--button for running script-->
<input class="button" type="button" id="button" name="button" value="Yes">
<!--begin javascript to edit html in above line-->
<script type="text/javascript">
<!--
//when button is clicked script edits html
document.getElementById('button').onclick = function () {
document.getElementById('norm').innerHTML="<h3>Welcome!!!</h3>";
};
document.getElementById('button').onclick
//-->
</script>
</div>
</body>
</html>
EDIT ADDED MISSING CSS TO QUESTION