Oculta div com checkbox

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script>

function hidechecked(obj, hide, condition) {
	if (obj.checked == condition) {
		$(hide).hide()
		//$(hide).fadeOut(500) //com animação 
	} else {
		$(hide).show()
		//$(hide).fadeIn(800) //com animação 
	}
}

<input type="checkbox" name="image_active" checked onclick="hidechecked(this, '.imagem',false)">

Was this article helpful?

Related Articles

Leave A Comment?