Last active
August 29, 2015 14:02
-
-
Save kaiinui/022162ef47e90748d9f4 to your computer and use it in GitHub Desktop.
Experimental. (465bytes when compressed, 247bytes when gzipped.)
This file contains hidden or 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
var W=window,E=W.Element,P="prototype"; | |
W.$$ = function(s, c){ | |
return (c ? c : document)['querySelectorAll'](s); | |
}; | |
W.NodeList[P].each = Array[P].forEach; | |
W.NodeList[P].forEach = Array[P].forEach; | |
E[P].find=function(q){ | |
return $$(q, this); | |
}; | |
E[P].attr=function(key, value){ | |
if(value){ | |
this.setAttribute(key, value); | |
return this; | |
}else{ | |
return this.getAttribute(key); | |
} | |
}; | |
E[P].css=function(prop, value){ | |
if(value){ | |
this.style[prop]=value; | |
return this; | |
}else{ | |
return this.style[prop]; | |
} | |
}; | |
E[P].on=function(type, callback){ | |
this.addEventListener(type, callback); | |
return this; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To verify minimal jQuery interface.
Working in less dependance to jQuery API is always better.
Mobile networks are still poor.
Supported Methods
Issues: