Here we are showing how the script can handle raw markup, adding the classes on the fly
Also showing the use of "noLinks" to keep from adding the +/x links to the second section
In this case, all the containers - div, ul, fieldset, paragraph - have a class of 'myfaq', and we simply call
$('.myfaq').makefaq();
to apply it to all of them at once!
<div class="myfaq">
<div>
<div>This set is simply divs, no class preassigned or anything!... see the source: </div>
<div>
<p><div class="myfaq"></p>
<p><div><br>
<div>This set is simply divs... see the source: </div><br>
<div>This should be an answer</div> <br>
</div></p>
<p><div><br>
<div>How is it working? </div><br>
<div>The faq script is adding the classes to our markup for us</div> <br>
</div></p>
<p><div><br>
<div>This is a question </div><br>
<div>This should be an answer</div> <br>
</div></p>
<p><div><br>
<div>This is a question </div><br>
<div>This should be an answer</div> <br>
</div></p>
<p></div></p>
</div>
</div>
<div>
This is a <ul> list with the class of 'noLinks' assigned, no classes on child elements
and hey, no links !
<ul class="noLinks myfaq">
<li>
<p>This is a <ul> list with the class of 'noLinks' assigned, no classes on child elements</p>
<p>and hey, no links ! </p>
</li>
<li>See the markup
<p> <ul class="noLinks myfaq"></p>
<p><li><br>
<p>This is a &lt;ul&gt; list with the class of 'noLinks' assigned, no classes on child elements</p><br>
<p>and hey, no links ! </p><br>
</li></p>
<p><li>See the markup<br>
<p>This should be an answer</p><br>
</li></p>
<p><li><br>
<p>This is a question</p><br>
<p>This should be an answer</p><br>
</li></p>
<p></ul></p>
</li>
<li>
<p>This is a question</p>
<p>This should be an answer</p>
</li>
</ul>
This is a question
This should be an answer
<div id="sample4" class="myfaq">
<div class="faq">
<div class="qq">
This section has all the classes preassigned...
</div><!-- / q -->
<div class="aa">
... and it still works!
</div><!-- / a -->
</div><!-- / faq -->
<div class="faq oo">
<div class="qq">
This is another question - it loads open with class oo
</div>
<!-- / q -->
<div class="aa">
This is another answer - loaded open
</div><!-- / a -->
</div><!-- / faq -->
<div class="faq">
<div class="qq">
See the markup
</div><!-- / q -->
<div class="aa">
--markup--
</div><!-- / a -->
</div><!-- / faq -->
<div class="faq">
<div class="qq">
This could be a question. Wanna bet?
</div><!-- / q -->
<div class="aa">
Nope! You lose.
</div><!-- / a -->
</div><!-- / faq -->
</div>
This is a <span> with nested spans inside, no preassigned classes Something else This is a question, loaded open with class "oo" This is the answer