JSFiddle - React, Tailwind, and code Playground

by Kamil

HTML

<label for="incometax">
  <input type="checkbox" name="check" onclick="showElement('incometax')" id="incometax">incometax
</label>
<input type="checkbox" name="check" onclick="showElement('gst')">
<input type="checkbox" name="check" onclick="showElement('tds')">

<ul id="incometax" style="display: none">
  <li>Return</li>
  <li>filling</li>
</ul>

<ul id="gst" style="display: none">
  <li>Form</li>
  <li>Return</li>
  <li>GSTR</li>
</ul>

<ul id="tds" style="display: none">
  <li>Application</li>
  <li>Refund</li>
</ul>

JavaScript

function showElement (element) {
        
        var checkbox = document.getElementsByName("check");
        var vis = "none";
        for(var i=0; i<checkbox.length; i++) { 
            if(checkbox[i].checked){
             vis = "block";
                break;
            }
        }
        document.getElementById(element).style.display = vis;
    
    
    }