Skip to content

Instantly share code, notes, and snippets.

@diegodfsd
Forked from FabioRodrigues/gist:1418984
Last active September 28, 2015 09:37
Show Gist options
  • Save diegodfsd/1419071 to your computer and use it in GitHub Desktop.
Save diegodfsd/1419071 to your computer and use it in GitHub Desktop.
DesabilitarNós
;function checkboxUtil(){
var input
, init;
this.init = function(seletor){
input = $("form input:checkbox");
var self = this;
input.live('click', function () {
var elemento = $(seletor);
self.desmarcar();
self.marcar(elemento);
});
};
this.desmarcar = function(){
input.each(function () {
this.checked = false;
});
};
this.marcar = function(elem){
elem.attr('checked', true);
}
};
};
var chkUtil = new checkboxUtil();
$(document).ready(function(){
chkUtil.init();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment