JSFiddle - React, Tailwind, and code Playground

by sushanth009

HTML

<label for="cell">3. Do you currently have a cell phone? (Y/N)</label>
<input type="checkbox" name="cell" name="cell" id="cell" data-on="Yes" data-off="No" />

<div id="divPhone" class="hidden">
  <label for="blackBerry">4.If YES, is the cell phone a BlackBerry? (Y/N)</label>
  <input type="checkbox" name="blackBerry" name="blackBerry" id= "blackBerry" data-on="Yes" data-off="No" />
</div>

CSS

.hidden
{
    display: none;
}

JavaScript

$('#cell').on('click', function() {
    if(this.checked){
       $('#divPhone').removeClass('hidden');
    }
    else{
       $('#divPhone').addClass('hidden');
    }        
});