the problem arises when you try to directly access the element with id="bob"
e.g. bob.innerHTML this will work on explorer
and is called global namespace polluting. and it could get things mixed up. So, a good practise is not to name DOM elements with javascript variables.
The reason you never ran into the problem is because that locally you create a variable with a reference to the DOM element, so you are practising a "workaround"