title: jQuery Find Next Anchor Element and Hide it?
body: <p>I have a Page with repeating anchors</p>
  
  <pre><code>&lt;div id ="div1"&gt;
   &lt;a class='button id='edit1'&gt;Edit&lt;/&gt;
  &lt;a class='button id='Close'&gt;Close&lt;/a&gt;
  &lt;/div&gt;
  &lt;div id ="div2"&gt;
   &lt;a class='button id='edit2'&gt;Edit&lt;/&gt;
  &lt;a class='button id='Close'&gt;Close&lt;/a&gt;
  &lt;/div&gt;
  &lt;div id ="div3"&gt;
   &lt;a class='button id='edit3'&gt;Edit&lt;/&gt;
  &lt;a class='button id='Close'&gt;Close&lt;/a&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>when i click Edit Anchor I need to find the next Close anchor with in the div and  hide is.</p>
  
  <p>This is how i tried it.</p>
  
  <pre><code>var anchors = $("a[class='button']");
      var position = anchors.index($('a[id=edit' + ID + ']'));
      var next = anchors.get(position + 1);
  **next.hide();** // Can i hide like this.
  </code></pre>
  
  <p>any suggestions?</p>
  
  <p>if you have noticed my close anchor will have a common id so i can be specific with ID</p>
  
  <p>More Details Can i do it in a function</p>
  
  <pre><code>function abc(id){ 
  $('a[id=edit' + id + ']').next('.change').hide();
  }
  </code></pre>