title: How to do Onclick Button show and Hide in foreach case using jquery or javascript?
body: <p>I am using a accordion for closing and opening content when clicked. </p>
  
  <p>It has a bar section which, when clicked, content below will show like on this example : <a href="http://jeevanscientific.com/resources.html" rel="nofollow noreferrer">http://jeevanscientific.com/resources.html</a></p>
  
  <p>I need to add a up button/downbutton on rightside of each bar.<br>
  Once clicked on particular bar only that bar shows down button. It is like hiding and showing down and up button with respect to button click.  </p>
  
  <p>The problem is that I am using a foreach to display items. How can I implement this scenario ?</p>
  
  <p>Here is my HTML :      </p>
  
  <pre><code>foreach (var i in footerPage.StaticPagePersons)
  {
      &lt;H1&gt;@Html.Raw(@i.Type) &lt;/H1&gt;
      &lt;div class="accordion" id="accordion2"&gt;
          &lt;div class="accordion-group"&gt;
              &lt;div class="accordion-heading datalist" id="" data-toggle="collapse" data-parent="#accordion2" href="#@i.Id"&gt;
                  &lt;i class="fa fa-chevron-down table-middle" aria-hidden="true"&gt;&lt;/i&gt;
                  &lt;i class="fa fa-chevron-up table-middle" aria-hidden="true"&gt;&lt;/i&gt;
                  &lt;h1 class="accordion-toggle table-middle"&gt;
                      @Html.Raw(@i.Name)
                  &lt;/h1&gt;
              &lt;/div&gt;
              &lt;div id="@i.Id" class="accordion-body collapse out"&gt;
                  &lt;div class="accordion-inner"&gt;
                      &lt;img ng-src="@i.ImagePath" alt="logo" class="img-thumbnail img-wrap content-image" /&gt;
                      &lt;h1&gt;@Html.Raw(@i.Name)&lt;/h1&gt;
                      &lt;h3&gt;@Html.Raw(@i.Title)&lt;/h3&gt;
                      &lt;br /&gt;
                      @Html.Raw(@i.BioDetail)
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  }
  </code></pre>
  
  <h3><a href="https://stackoverflow.com/questions/37882237/#comment-63267601">Clarification</a></h3>
  
  <p>right side of each tab.. that's requirement... when clicked should show up button, else down button</p>