0

I'm having trouble with this code. Whenever i clicked the button to show the hidden text, it displays the text but only like for 1 second and hides again. Am i missing or something?

$(document).ready(function(){
$("h3").hide();

$(window).load(function(){
  $('#loginbutton').click(function(){
    $("h3").show();


});
});
});
2
Contributors
2
Replies
3
Views
4 Years
Discussion Span
Last Post by Eggstraordinary
0

Here is some working code you can adapt to your needs....

<h3>Content</h3>
<button id="loginbutton">Click</button>  
<script>
  $(document).ready(function(){
     $("h3").hide();
     $('#loginbutton').click(function(){
       $("h3").show();
     });
  });
</script>
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.