I have a div with a button at the end. I want that when someone clicks on this button, another div (below the previous one) should appear with the content that I placed 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 jquery with script:
<script> $(function() { $( "#button" ).click(function() { $( "#item" ).toggle(); }); }); </script>
The problem I am facing is that the second div appears on the initial loading of the page, and when I click the button, it disappears. What should I do?
javascript jquery html
Navneet malviya
source share