-8
How to turn on and off a div
by clicking on checkbox
$("#chkBloqueio").click(function() {
if ($("#chkBloqueio").attr('checked') == true) {
$("#divBloqueio").attr('display', 'inline');
} else {
$("#divBloqueio").attr('display', 'none');
}
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="divBloqueio" runat="server" style="display:none"></div>
Hello @Matheus. You need to give more detail in your question: what you want, what difficulties, etc, otherwise we will not be able to help you.
– João Martins
Set "Disable". Would you hide it? Remove it from the DOM? Make all
<input>
within itdisabled
?– fernandosavio
The "on/off" would make it visible in the DOM, when the checkbox is checked the Div will be display:inline. (Sorry I didn’t clear it up initially)
– Matheus Vinicius