Hello, I would like to know how to make toggle hidden when the page loads, I made simple code, but when the page loads, it will be displayed by default. I want it to be around.
I need to try using CSS something like
.hidden {
display:none;
}
when I use this code, the item is not displayed at all.
this is my code
edited
<script type="text/javascript">
function toggleDiv(divId) {
$("#"+divId).toggle();
}
</script>
<a href="javascript:toggleDiv('myContent');">this is a test</a>
<div id="myContent">
<a href="javascript:toggleDiv('myContentt');"><span>this is a text</span></a>
<div>this is a test #2 </div>
</div>
<div id="myContentt">
test
</div>
Please, help.
source
share