I have a div with a button at the end. I want that when someone presses that button another div (below the previous one) should appear with the content I have put it inside the div.
I am using the following code:
HTML:
<div>
<a id="button" href="#">REGISTER</a>
</div>
<br>
<br>
<div id="item">
<iframe src="some source" embedded=true" width="760" height="550" frameborder="0" marginheight="0" marginwidth="0">Loading</iframe>
</div>
and the jquery with script:
<script>
$(function() {
$( "#button" ).click(function() {
$( "#item" ).toggle();
});
});
</script>
The problem I am having is that the second div is appearing on page load itself initially and when I am clicking on the button its disappearing. What should I do?