JSFiddle - React, Tailwind, and code Playground

by hcanning2012

HTML

<div>
        <label><input type="checkbox" name="colorCheckbox" value="n1"> num 1</label>
        <label><input type="checkbox" name="colorCheckbox" value="n2"> num 2</label>
        <label><input type="checkbox" name="colorCheckbox" value="n3"> num 3</label>
    </div>
    <div class="n1 box">55000</div>
    <div class="n2 box">200</div>
    <div class="n3 box">300</div>

CSS

.box{
        display: none;
    }

JavaScript

$(document).ready(function(){
    $('input[type="checkbox"]').click(function(){
        var inputValue = $(this).attr("value");
        $("." + inputValue).toggle();
    });
});