I m trying to do multistep form, and I have 5 div s (all of them hidden) The five of them are parts of a form so I can get the first and the last div by doing this
var first = $("#new").children(":first").next();
var last = $("#back").prev( div );
"#new" is the id of the form, and "#back" the id of the back button. After click on the NEXT button it shows first.next(); , but it should only work the first time then it should display the next() of the div that is visible.
我怎么能够做到这一点?
增 编
EDIT: I m trying to do this because after I click next on the first div then it shows the second div, and after that the third an so on, but I want to do a function where it automatically detects wich one is visible.