I have a FAQs page that reads from XML using XSl code, The div for the question and answer will be repeated as much as the number of records in the XML.
This is the XSL
HTML 101: Ids are singular, you can not have more than one item with the same id!
Use a class! Use next()
HTML:
XXX YYY XXX YYY XXX YYY
JavaScript:
$(document).on("click",".question", function(){ $(this).next().toggle(); });
Example
http://jsfiddle.net/8xvTM/1/