Hello,
I’m using some javascript to show a part of the page if a user answers a question correctly:
<script type="text/javascript">
$(document).ready(function(){
$('#solution').hide();
$('.magic_solution').click(function() {
$('#solution').slideToggle("slow");
return false;
});
});</script>
<label>
<input type="radio" name="subtracting_radio" value="yes" id="subtracting_radio_0" />
yes</label>
<label>
<span class="magic_solution"><input type="radio" name="subtracting_radio" value="no" id="subtracting_radio_0" /></span>
no</label></p>
<div id="solution"><p><img src="../../images/user_reaction/correct_check.png" width="48" height="39" /> If you subtract 3 from 3 you get don't get a counting number. Further, if you subtract 5 from 3 you don't get a counting number.</p>
The code works in terms of the div solution is hidden until the user clicks “no”. However, if the user clicks yes first and then no, the hidden solution shows, but the “no” button itself doesn’t become selected. Is there anyway that I can add this in to my jquery code so that the button is highlighted as well? Or am I stuck with one behavior or the other?
Thank you,
Eric