title: How get document.getElementById when I add this id in previous JS
body: <p>I have added an id to all elements with a class of image using JS. 
  The images now have ids eg. <code>image--1</code>, <code>image--2,</code> etc</p>
  
  <p>If I want to get the element by ID using <code>var el = document.getElementById('image--1');</code> then I get null. </p>
  
  <p>How can I get current DOM in pure JS?</p>