Remove class when checked

CharlesXF

New member
Hi !
I would like to know how to remove class when a checkbox is checked.
I've tested some JavaScript code but these tests was not a success :(

I want to remove class from a textbox if the checkbox is checked :)
My code
Code:
<input type="checkbox" id="checkIn" name="checkTo" />
<input type="text" id="chedTo" class="textCtrl disabled" disabled />

And my JS code :
Code:
if (document.getElementById('checkIn').checked)
{
    document.getElementById('chedTo').removeClass('disabled');
}

This doesn't work :(
Some help please ?
 
try this

Code:
$(document).on('click', '.checkIn', function(e) { if ($(this).is(':checked')) { $('#chedTo').removeClass('disabled'); } });
 
Back
Top Bottom