-
-
Save diegodfsd/1419071 to your computer and use it in GitHub Desktop.
DesabilitarNós
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;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