title: Get dynamic Id from dynamic elements
body: <p>I have div element with dynamic Id.</p>
  
  <pre><code>&lt;div id="parent"&gt;
      &lt;div id="elmn1"&gt;&lt;/div&gt;
      &lt;div id="id-has-changed"&gt;&lt;/div&gt;
      &lt;div id="elmn3"&gt;&lt;/div&gt;
      &lt;div id="elmn4"&gt;&lt;/div&gt;
      &lt;div id="id-has-changed-by-user-from-input-field"&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>All element <code>id</code> (except #parent) are editable by user from an input field, so the last child of #parent may has new id set by user.</p>
  
  <p>I want to check the element with the highest  number (<code>4</code>) at the last part of their <code>id</code> and I want to append a new element with the next <code>id</code>.</p>
  
  <pre><code>var nextId = "elmn" + (numberOfLastElement + 1);
  var newElmn = document.createElement("div");
  
  newElmn.id = nextId;
  document.getElementById("parent").appendChild(newElmn);
  </code></pre>
  
  <p>In this paricular case the new element will has <code>id="elmn5"</code>.</p>
  
  <p>My question is, how to get <code>numberOfLastElement</code>?</p>