$(document).ready(function(){
$("button").click(function(){
$("p").hide();
});
});
$(document).ready(function(){
var a = $(".question");
a.each(function(index) {
var flip = $(this).find(".flip");
var panel = $(this).find(".panel");
flip.click(function(){
panel.slideDown("slow");
});
});
});
div.panel,div.flip
{
margin:0px;
padding:5px;
text-align:center;
background:#e5eecc;
border:solid 1px #c3c3c3;
width:140px;
}
div.panel
{
display:none;
}
div.question
{
float:left;
}
div.questions
{
height: 80px;
}
Here's an example makes it reasonably easy to add more questions once the initial javascript is in:
Javascript sample
1) How many bits are in a byte?