Wednesday, 18 September 2013

Multiple buttons on an html page to reveal text step by step rather than simultaneously?

Multiple buttons on an html page to reveal text step by step rather than
simultaneously?

trying to create a list of about 7 questions with a click to reveal answer
button next to each question. only problem is when i click one button, it
runs the entire js code and shows ALL the answers not just that particular
one.
here is my code
Question 1 $("form").submit(function() { $("#reveal-space").text("Answer
1").show(); return true; }); Question 2 $("form").submit(function() {
$("#reveal-space1").text("Answer 2").show(); return true; }); Question 3
$("form").submit(function() { $("#reveal-space2").text("Answer 3").show();
return true; }); Question 4 $("form").submit(function() {
$("#reveal-space3").text("Answer 4").show(); return true; });
how do i fix it to make it so that when the "1" button is clicked it
doesn't reveal the texts to the other buttons ? i may need to take an
entirely different approach
thanks for the help in advance

No comments:

Post a Comment