Nov 5, 2008

Cool Utiliy : Show Hide with JQuery!

Previously while working with javascript and div, it did get me very confused,
with code required to hide/show a paragraph. Well it seems jquery has the
feature nicely put in, implementing the css div hide in a short few lines,
of code.
Here it is :-
$(document).ready(function(){
$('#faq').find('dd').hide().end().find('dt').click(function() {
$(this).next().slideToggle();
});
});

and include it in the HTML code :-

No comments: