CheckBox via jQuery
02 September 2018
Web
Development
JavaScript
jQuery
HTML:
<!-- Checkbox placed -->
<input class="form-check-input" type="checkbox" id="maker_check" value="1"onchange="valueChanged()">
<label class="form-check-label" for="defaultCheck1">
<!-- Show/Hide Box -->
<div id="_maker">
<p>Hello World!</p>
</div>
JS:
function valueChanged()
{
if($('#maker_check').is(":checked"))
$("#_maker").show();
else
$("#_maker").hide();
}
jQuery:
// jQuery is needed
<script src="https://code.jquery.com/jquery-3.3.1.js"></script>