I am trying to uncheck a box when another is checked. I have it all working except I need to know the opposite of this.checked as well as the opposite of !!this.checked.
Basically I want to use my present method which works rather than change all my code for a new method, so I just need to know the opposite.
this.checked checks the checkbox, but I want the opposite so when it runs it UNchecks it.
var chk1 = $("#theIDofmyCheckbox1");
var chk2 = $("#theIDofmyCheckbox2");
chk1.change(function(){
chk2.prop( "checked", false );
// need to set local storage so it saves
chrome.storage.local.set({'theIDofmyCheckbox2': !!this.checked});
});
Aucun commentaire:
Enregistrer un commentaire