title: How to access nested html-child elements in javascript
body: <p>I'm using a html-form with nested div-elements with this structure:</p>
  
  <pre><code>&lt;form id="form"&gt;
      &lt;div id="parentproperties"&gt;
          &lt;legend class="itemName"&gt;People&lt;/legend&gt;
          &lt;br&gt;
          &lt;div id="properties1"&gt;
              &lt;legend class="itemName"&gt;Name&lt;/legend&gt;
              &lt;label class="valueId"&gt;JaneDoe&lt;/label&gt;
              &lt;br&gt;
              &lt;label class="labelId"&gt;Id: &lt;/label&gt;
              &lt;input class="inputId"&gt;5646543&lt;/input&gt;
          &lt;/div&gt;
          &lt;div id="properties2"&gt;
              &lt;legend class="itemName"&gt;Address&lt;/legend&gt;
              &lt;label class"valueId"&gt;MysteriousStreet&lt;/label&gt;
              &lt;br&gt;
              &lt;label class="labelId"&gt;Id: &lt;/label&gt;
              &lt;input class="inputId"&gt;1234&lt;/input&gt;
          &lt;/div&gt;
          &lt;div id="properties3"&gt;
              &lt;legend class="itemName"&gt;Country&lt;/legend&gt;
              &lt;label class"valueId"&gt;SomeCountry&lt;/label&gt;
              &lt;br&gt;
              &lt;label class="labelId"&gt;Id: &lt;/label&gt;
              &lt;input class="inputId"&gt;7899542&lt;/input&gt;
                      &lt;div id="properties4"&gt;
                      &lt;legend class="itemName"&gt;&lt;/legend&gt;
                      &lt;br&gt;
                      &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Now I need to access the field with the Id 'valueID' for every 'div' to change a specific value. I've tried several loops but they do not not work properly... Later I've tried to get a particular element directly this way: </p>
  
  <pre><code>document.getElementById("properties").childNodes[0].innerHTML;
  </code></pre>
  
  <p>...but I only get the first valueId with value 'JaneDoe'. 
  Thanks in advance for any ideas!</p>