jquery - show hidden div when click value radio button -
hy guys show div when click on value radio button. html:
<form id="risp"> <input id="ris1" type="radio" name="ris" value="err1"> <label class="answer">0</label> <input id="ris2" type="radio" name="ris" value="err1"> <label class="answer"> 2</label> <input id="ris3" type="radio" name="ris" value="correct1"> <label class="answer">5</label> </form> <div id="correct"> <p>answer correct</p> </div> so try function:
$("#ris3").click(function () { $("correct").show(); but don't function!!why?? thanx
it's because:
$('correct') should be:
$('#correct') the problem selector wrong. keep in mind selector $('correct') looking <correct> element not exist. ids, have use # , . classes either 1 before actual value. can find more information on jquery selectors here: http://api.jquery.com/category/selectors/
note: stuart kershaw mentioned on comment below, remember close click function, otherwise won't work...
Comments
Post a Comment