I have a simple example to show or not a <div id="oculto"></div>
when clicking on a input checkbox
using javascript
. But I have the peculiarity that when I perform the event click
, the action of showing what is hidden is not executed. This input type="checkbox"
has a class="flat"
that allows to give better appearance to the checkbox
; and I have noticed that when I remove this class="flat"
from Bootstrap
the function that is executed with the event it $('#es_titulo').click(function (){});
works perfectly.
Perhaps it is some detail that I am not realizing and the solution is very simple, but I leave the code looking for some suggestion.
The checkbox:
<div class="checkbox">
<label>
<input type="checkbox" class="flat" id="es_titulo" > Proceso de Título
</label>
</div>
<div class="col-xs-12" style="padding-top: 2%; display: none;" id="caja_bolsa">
</div>
The function I use to display:
$('#es_titulo').click(function (){
if ($('#es_titulo').prop('checked')) {
$('#caja_bolsa').show();
} else {
$('#caja_bolsa').hide();
}
});