title: How to detect element inner elements by id using javascript?
body: <p>How to detect elements inner elements reference by id using javascript ?</p>
  
  <p>I have 3 elements <code>&lt;div&gt;</code> like this, I want to detect <code>&lt;span id="inner"&gt;</code> inner <code>&lt;div id="outer_3"&gt;</code> exists or not ?</p>
  
  <p>in this code, Answer will show <code>not</code></p>
  
  <p>How can i do that?</p>
  
  <pre><code>&lt;div id="outer_1"&gt;
      &lt;span id="inner"&gt;
      &lt;/span&gt;
  &lt;/div&gt;
  
  &lt;div id="outer_2"&gt;
      &lt;span id="inner"&gt;
      &lt;/span&gt;
  &lt;/div&gt;
  
  &lt;div id="outer_3"&gt;
  &lt;/div&gt;
  </code></pre>