1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Remove class when checked

Discussion in 'XenForo Development Discussions' started by CharlesXF, Nov 19, 2014.

  1. CharlesXF

    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
    <input type="checkbox" id="checkIn" name="checkTo" />
    <input type="text" id="chedTo" class="textCtrl disabled" disabled />
    And my JS code :
    if (document.getElementById('checkIn').checked)
    This doesn't work :(
    Some help please ?
  2. Daniel Hood

    Daniel Hood Well-Known Member

    try this

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

    CharlesXF New Member

    Thanks :D

Share This Page