PhilipK Posted June 28, 2011 Share Posted June 28, 2011 Hey everyone, I'm building a Jquery based survey. It is structered a so... <form> <input type="radio" name="answer" value="Yes" id="yes" /> Yes<br /> <input type="radio" name="answer" value="No" id="no" /> No </form> <p>If Yes answer </p> <p>If No answer </p> I need a piece of javascript that when you click on yes it does --> $('p').show('slow'); <-- but I need to only select the next p If they click no I need to select only the 2nd answer. Quote Link to comment Share on other sites More sharing options...
PhilipK Posted June 28, 2011 Author Share Posted June 28, 2011 $(".yes").click(function () { $(this).parent().next("p").show("fast"); }); $(".no").click(function () { $(this).parent().next("p").next("p").show("fast"); }); Quote Link to comment Share on other sites More sharing options...
spiderwell Posted June 28, 2011 Share Posted June 28, 2011 looks like you answered your own problem there buddy, mark it solved Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.