/ Published in: JavaScript
It doesn't require prototype.js
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function $() { var elements = new Array(); for (var i = 0; i < arguments.length; i++) { var element = arguments[i]; if (typeof element == 'string') element = document.getElementById(element); if (arguments.length == 1) return element; elements.push(element); } return elements; }