Noobie Jquery Question
        Posted  
        
            by piratebill
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by piratebill
        
        
        
        Published on 2010-06-02T21:21:52Z
        Indexed on 
            2010/06/02
            21:24 UTC
        
        
        Read the original article
        Hit count: 270
        
jQuery
I've been working with Jquery fro a grand total of two hours now. Up until this point I have made this really simple FAQ page.
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#void").click(function(event)
     {
        event.preventDefault();
    });
  $('#faq').find('dd').hide().end().find('dt').click(function() {
 $(this).next().slideToggle();   
}); });
</script>
    <dl id="faq">
        <dt><a href="" id="void">Coffee</a></dt>
            <dd>- black hot drink</dd>
    <dt><a href="" id="void">Milk</a></dt>
        <dd>- white cold drink</dd>
    </dl>
The problem is only the first item is working. My questions are, why is only the first entree working and how do I fix it? I've tried using an each() but I am unsure where to put it.
© Stack Overflow or respective owner