Advertisement
Guest User

Untitled

a guest
Oct 18th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. $(document).ready(function(){
  2. console.log('jquery is installed and running.');
  3.  
  4. //creates an array of checkboxes
  5. let options = $('input[name="PotentialConsequence"]').toArray();
  6.  
  7. //iterate through array and to confirm if checked
  8. $.each(options, function() {
  9. $(this).on('change', function() {
  10.  
  11. for (let i=0; i<options.length; i++){
  12. if (options[i].checked == true){
  13. continue;
  14. }
  15. options[i].disabled = true;
  16. }
  17. });
  18. });
  19. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement