Created
October 11, 2013 15:18
-
-
Save jafstar/6936517 to your computer and use it in GitHub Desktop.
Vanilla JS
This file contains 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
//VARS | |
var $ = document; | |
var doc = $; | |
$.id = function(x){ | |
return this.getElementById(x); | |
} | |
$.class = function(x){ | |
var e = document.getElementsByTagName('*'); | |
var list = []; | |
for(var i=0; i < e.length; i++){ | |
if(e[i].className == x){ | |
//DEBUG | |
//console.log(e[i]); | |
//PUSH | |
list.push(e[i]); | |
} | |
} | |
//RETURN | |
return list; | |
} | |
//ONLOAD | |
$.onload = start(); | |
//START | |
function start(){ | |
console.log('app started'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment