Let's say I have a div like this:
<div class="box-body">
<a href="#" id="hideshow">Hide</a></br>
<div id="message">
<p>password: <input type="password" name="blog_pass"></p>
</div>
</div>
Basically what I want to do is to hide the div message
when I click on the hideshow
link and show it again when I click on this link again.
So I added a script at the end of my page in order to do this:
$('#hideshow').toggle(function(){
$('#hideshow').text('Show');
$('#message').hide();
}, function(){
$('#hideshow').text('Hide');
$('#message').show();
});
But now the problem is it does not even work out. I mean no error appears on console and even the link Hide
is not showing somehow.
So what is your idea about this... How can I fix this?