Advertisement
Guest User

Untitled

a guest
May 30th, 2015
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var template.prototype.options = [{
  2.         attr:[
  3.           {
  4.             tabindex: "0"
  5.           },
  6.           {
  7.             dataset: ""
  8.           },
  9.           {
  10.             role: "link"
  11.           }
  12.         ]
  13. }];
  14.  
  15. template.addLink = function(elem, options){
  16.       var el = document.querySelectorAll(elem);
  17.       var forEach = Array.prototype.forEach;
  18.      
  19.      
  20.       el.forEach(function(item){
  21.           options.attr.dataset = item.dataset;
  22.           function setAttr(item, options){
  23.             for(var key in options){
  24.               item.setAttribute(key, options[key]);
  25.             }
  26.           }
  27.       });
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement