title: How to hide child elements using javascript
body: <pre><code>&lt;div id="wpq2"&gt;
     &lt;div class="subClass"&gt;
     &lt;a id="linkTO" class="subClass"&gt;New Item&lt;/a&gt;
     or
     &lt;a class="subClass"&gt;edit&lt;/a&gt;
     this list
     &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>i want to hide all the thing except </p>
  
  <pre><code>   &lt;a id="linkTO" class="subClass"&gt;New Item&lt;/a&gt;
  </code></pre>
  
  <p>I do not have access to html , 
  i have to use javascript </p>
  
  <p>i tried somthing</p>
  
  <pre><code>var parentID = document.getElementById('wpq2');
  var sub = parentID.getElementsByClassName('subClass');
  var lastChild = sub[0].lastChild;
  lastChild.style.display = 'none';
  </code></pre>
  
  <p>Using javascript no idea how to do </p>
  
  <p>Please suggest</p>