I have a div that should be shown only when the user clicks the show button
$(\"div.toshow\").show();
I have written in the body
.toshow{
display:none;
}
or
.toshow{
visibility:hidden;
}
You can use CSS display
:
.toshow
{
display: none;
}
$('#myDiv').hide();
$("myDiv").css("visibility", "hidden");
.toshow {
visibility:hidden;
display:none;
}
Yes you can can use style
like this:
<div class="toshow" style="display:none"></div>
You can use jQuery to change the CSS styles of 'toshow' class adding "display: none". for example
$(function(){
$('.toshow').css("display", "none");
});
To do it in the body:
<body>
<div class="toshow" style="display:none">
</div>
</body>
Although I would avoid inline css