JSFiddle - React, Tailwind, and code Playground

by Irvin Dominin

HTML

<input id="name" type="text" />
<input id="email" type="text" />
<input id="radio" name="test" type="radio" v/>
<input id="radio" name="test" type="radio" />
<br><br>    
<input id="radio" name="tesht" type="radio" value="1" />

<br><br>

<a class="next">show div</a>

CSS

.next {
    display: none;
}

JavaScript

$(function () {
    $('input').change(function () {
        $('.next').toggle($("input").filter(function () {
            var myType=$(this).attr("type");
            if (myType === "checkbox") return !$(this).is(":checked");
            if (myType==="radio"){
                var myName = $(this).attr("name");
                if (myName==="") return !$(this).is(":checked");
                return $('input[name='+ myName +']:checked').length===0
            }
            return this.value === "";
        }).length === 0)
    });
});