Using toggle function - hide on load as default
Hi,
I'm rather new to jQuery though I would like to learn more...
Anyway, I am using some code that someone else wrote so I claim no credit here for the code. It works great and I've managed to persuade to work in Wordpress but I have one thing I would like to change.
Basically the text I am trying to toggle is "shown" on page load - I would like it to be "hidden" until the user clicks on the link to make it appear.
Here's the code:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js"></script>
<script type="text/javascript">
$(function() {
$('a#faq').click(function() {
$('div#hidden').toggle();
return false;
});
});
</script>
</head>
<body>
<a href="#" id="faq">F A Q</a><br />
<br />
<div id="hidden">
Some Questions
Some Answers
</div>
</body>
</html>
If any one can help me make sure the text is hidden on page load I would be very grateful.
Thanks.