I always thought there was a better way to access the dom. This is a tool that allows you to use extremely simple syntax to access dom elements. It makes an object with the name of your choice (I chose "$") that contains a reference to all elements that have an id.
example:
<script> $.foo.innerHTML = "Hello world" </script>
You can even choose to use an object that already exists (I chose "document" because it makes sense)
document.foo.innerHTML = "Hello world"
If you want to live dangerously, you can even make everything global!
foo.innerHTML = "Hello world"
@p01
The problem with both of your edits is the fact that you reset "a" to an empty object. My code has to allow using an object that already exists, for example: "document".
I will take into condideration your "?" idea tho :)