title: Hide/show button is not working properly
body: <p>I have an edit button that on click needs to disappear i've tried the following code but the button is working only for the first tr, if I click the second line the button on the first line disapears, what's wrong with my code?</p>
  
  <pre><code>function Edit(clickedButton){
  
     var getTR = clickedButton.closest('tr');
      var getLength = getTR.childElementCount;
      var getTds = getTR.querySelectorAll("td")
  
      for (i in getTds){
          if(i &lt; (getLength-1)){
          getTds[i].innerHTML = "&lt;input  type='text' value='"+getTds[i].innerHTML+"'&gt;";
          }       
      }
  
      btnEdit.style.display = 'none';
  }
  </code></pre>
  
  <p>HTML:</p>
  
  <pre><code>&lt;table id="table" class="table .table-bordered" &gt;
          &lt;thead&gt;
              &lt;tr&gt;
                  &lt;th&gt;ID&lt;/th&gt;
                  &lt;th&gt;First Name&lt;/th&gt;
                  &lt;th&gt;Last Name&lt;/th&gt;
                  &lt;th&gt;DOB&lt;/th&gt;
                  &lt;th&gt;Gender&lt;/th&gt;
                  &lt;th&gt;Martial Status&lt;/th&gt;
                  &lt;th&gt;Action&lt;/th&gt;
              &lt;/tr&gt;
          &lt;/thead&gt;
          &lt;tbody&gt;
              &lt;tr&gt;
                  &lt;td class="user"&gt;1&lt;/td&gt;
                  &lt;td class="firstName"&gt;Sr&lt;/td&gt;
                  &lt;td class="lastName"&gt;Kar&lt;/td&gt;
                  &lt;td class="dob"&gt;1-12-1990&lt;/td&gt;
                  &lt;td class="gender"&gt;Male&lt;/td&gt;
                  &lt;td class="status"&gt;Married&lt;/td&gt;
                  &lt;td&gt;
                      &lt;button class="btnEdit" onclick="Edit(this)"&gt;Edit&lt;/button&gt;
                      &lt;button class="btnDel" onclick="Delete(this)"&gt;Delete&lt;/button&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
  &lt;tr&gt;
                  &lt;td class="user"&gt;2&lt;/td&gt;
                  &lt;td class="firstName"&gt;kajs&lt;/td&gt;
                  &lt;td class="lastName"&gt;kasjk&lt;/td&gt;
                  &lt;td class="dob"&gt;29-07-1995&lt;/td&gt;
                  &lt;td class="gender"&gt;Female&lt;/td&gt;
                  &lt;td class="status"&gt;Single&lt;/td&gt;
                  &lt;td&gt;
                      &lt;button class="btnEdit" onclick="Edit(this)"&gt;Edit&lt;/button&gt;
                      &lt;button class="btnDel" onclick="Delete(this)"&gt;Delete&lt;/button&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
  &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>