Why do you always think of yourself as an employee? My intention is to remove the checked attribute but I can not get it.
I looked this thread and I think I do it as the solution proposes, but it does not work for me.
$(document).ready(function() {
$('.radio').click(function() {
if ($('#radio-Empleado').is(':checked')) {
$('#radio-Cliente').removeAttr('checked');
alert('Soy empleado');
} else if ($('#radio-Cliente').is(':checked')) {
$('#radio-Empleado').removeAttr('checked');
alert('Soy cliente');
} else {
// Si los ninguno de los dos está selecionado
alert('Ningún radiobutton seleccionado');
}
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="Contenedores">
<h2> Define si eres empleado o cliente</h2>
<div id="Cont-Select-EmpCli">
<input type="radio" class="radio" id="radio-Empleado">
<label for="radio-Empleado">Empleado</label>
<input type="radio" class="radio" id="radio-Cliente">
<label for="radio-Cliente">Ciente</label>
</div>
</div>
Cheers!