Tags

links:
http://stackoverflow.com/questions/978799/is-there-an-easy-way-to-convert-jquery-code-to-javascript

summary:

var $ = function(e) {
if(typeof e !== “undefined”)
return document.querySelectorAll(e);
};

$.id = function(i){return document.getElementById(i)};
$.class = function(c){return document.getElementsByClassName(c)};
$.tag = function(t){return document.getElementsByTagName(t)};

Advertisements