title: How to implement onclick event only for current button?
body: <p>I want to show/hide div with children on button click, but not other same divs in different parent blocks.
  Sorry for my bad explanation and js knowledge, maybe the code can speak better:</p>
  
  <pre><code>for (a = 0; a &lt; document.querySelectorAll("#hidereplies").length; a++) {
      var btn = document.querySelectorAll("#hidereplies")[a];
      btn.onclick = function () {
          for (var y = 0; y &lt; document.querySelectorAll(".reply_comments").length; y++) {
              var reply = document.querySelectorAll(".reply_comments")[y];
              reply.style.display = (reply.style.display != 'none' ? 'none' : 'block');
          }
      };
  }
  </code></pre>
  
  <p><a href="http://jsfiddle.net/glebcha/yhtKa/3/" rel="nofollow">Demo on jsfiddle</a>.</p>