How can I emulate the jQuery $ selector in pure javascript? : <p>Using the jQuery $ selector makes getting DOM elements a lot easier. I want to be able to replicate this selector in plain javascript. How would I do this?</p>

<p>Note: I do not want to replace all instancew of <code>$('')</code>in my code with <code>document.querySelector()</code>, rather, I want to define <code>$</code> as a function.</p>
