How to display a specific alert with radio buttons using jQuery?
<p>I have a form with two radio buttons, "Yes" and "No", that toggles visibility of a div.</p>

<p>I'd like to display an alert to the user if the "No" option is selected ONLY when the "Yes" option is already selected. </p>

<p>If neither option has been selected and "No" is clicked, the alert should not display.</p>

<pre><code>$('.toggle').on('change',function(){

    var showOrHide = false;

    $(this).siblings('input[type=radio]').andSelf().each(function() {

        if ($(this).val() == 1 &amp;&amp; $(this).prop("checked")) showOrHide = true;

    })    

    $(this).parent().parent().next('.group').toggle(showOrHide);    

}).change()  
</code></pre>
