Checkall JQuery Plugin.
authorSven Schöling <s.schoeling@linet-services.de>
Thu, 7 Jan 2010 10:43:47 +0000 (11:43 +0100)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Fri, 5 Mar 2010 09:19:25 +0000 (10:19 +0100)
js/jquery.checkall.js [new file with mode: 0644]

diff --git a/js/jquery.checkall.js b/js/jquery.checkall.js
new file mode 100644 (file)
index 0000000..4b53049
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+ * jQuery SelectAll plugin 1.1
+ *
+ * Copyright (c) 2009 Sven Schöling
+ */
+
+;(function($) {
+
+$.fn.extend({
+  checkall: function(target) {
+    var saved_this = this;
+    return $(this).click(function() {
+      $(target).each(function() {
+        $(this).attr('checked', $(saved_this).attr('checked'));
+      });
+    });
+  }
+});
+
+})(jQuery);