Testing of the attribution and removal of it by click if found



  • Please indicate how c jQuery verify the presence in the attribute element and if the attribute is found in the evidence for this element, remove the attribute.

    For example:

    <input type="checkbox" id="confirm_agree" checked />
    

    input - component

    checked - Attribute



  • $('input[checked]').click(function(){
      $(this).removeAttr('checked');
    });
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
    <input type="checkbox" id="confirm_agree" checked>




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2