Response title
This is preview!
$(document).ready(function() {
$('#faq').find('dd').hide().end().find('dt').click(function() {
$(this).next().slideToggle(); }); });
end()
, the first find()
is undone, so we can start search with the next find()
at our #faq element, instead of the dd children.i have often noticed the use of event inside function() as in code below. could
someone tell me what is its use and what would happen if i do not use it?
$(document).ready(function(){ $("a").click(function(event){ alert("Thanks for visiting!"); }); });
© 2013 jQuery Foundation
Sponsored by and others.