I have this code and I want to use it in a joomla site. I've been trying to put it into an article or a module using codemirror, jce or no editor at all, but the toggling doesn't work at all and as result the answer won't show. I've also tried to put it into an iframe but there was a problem with the auto height and no fix was good enough. Any help would have been highly appreciated, 'cause after 48 hours of searching the web for a solution, it seems like I'm in a dead end right now. Thanks in advance!
<script src="diabetes-faq/js/jquery-1.9.1.min.js"></script>
<script>
$(document).ready(function() {
$('#faq-list h2').click(function() {
$(this).next('.answer').slideToggle(500);
$(this).toggleClass('close');
});
}); // end ready
</script>
<body>
<div id="wrapper">
<div id="main">
<section id="faq-list">
<h2>Question No1</h2>
<div class="answer">
<p>blah blah blah</p>
</div>
<h2>Question No2</h2>
<div class="answer">
<p>blah blah </p>
</div>
<h2>Question No3</h2>
<div class="answer">
<p>blah blah blah</p>
</div>
</section>
</div>
</div>
</body>