I'm trying to have JQuery change the content of div tags so that it makes it look like the user is going through multiple pages. The way I have it is that the user will hit a button, once they hit the button a script will run and change the content of divs. I wanted to have at least three pages to be done like this, but I run in to a problem after the second page. Here is what I have in the script:
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#1").click(function() {
$("#leftPart").html('<input type="text" id="blash" value="blash" name="blash" ><input type="text" id="hello" value="hello" name="hello" ><input type="text" id="world" value="world" name="world" ><input type="button" name="submit" id="2" value="Submit" />');
$("#rightPart").html('');
});
$("#2").click(function() {
$("#rightPart").html('<input type="text" id="meep" value="meep" name="meep" ><input type="text" id="glomp" value="glomp" name="glomp" >');
});
});
So once I click on the button on the first page, with an id of '1', then it changes the screen to what the second page should show. The second page will display some stuff and create another button with the id of '2'. When I then try to click on the button from the second page, with an id of '2', it doesn't do anything. Any help? Is it because the button is created with the script instead of actually being in the html?