Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var template.prototype.options = [{
- attr:[
- {
- tabindex: "0"
- },
- {
- dataset: ""
- },
- {
- role: "link"
- }
- ]
- }];
- template.addLink = function(elem, options){
- var el = document.querySelectorAll(elem);
- var forEach = Array.prototype.forEach;
- el.forEach(function(item){
- options.attr.dataset = item.dataset;
- function setAttr(item, options){
- for(var key in options){
- item.setAttribute(key, options[key]);
- }
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement