Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "use strict";
- (function($) {
- $.fn.myPlugin = function(options) {
- var o = $.extend ({
- "header": "header",
- "odd": "odd",
- "even": "even"
- }, options);
- return this.each(function() {
- var row= this.getElementsByTagName("tr");
- for(var i=0;i<row.length;i++){
- if(i==0){
- row[i].setAttribute("class",o.header);}
- if( i % 2 == 0 && i != 0){
- row[i].setAttribute("class",o.even);
- }
- else{
- if(i!=0){
- row[i].setAttribute("class",o.odd);}
- }
- }
- });
- };
- })(jQuery);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement