Help with Query Selector

Help with Query Selector

Hello,

I'm trying to figure out the jQuery selector so that I can change an item but for some reason I can't figure it out to select it.  I"m trying to get to the <button> in the following html.  I can change the <tr>, <td> or even <div> but I can't get to the <button>.

What I'm trying to do is when I select an HREF from the dropdown button then I turn on the LaddaSpinner for that button.  This just shows a spinner to the right of the button.  I'm trying to use the "closest" selector to turn on the spinner for that button when an action has been selected from the dropdown.

Any ideas?


HTML

  1. <td  class=" min-tablet" >
    <div  class="btn-group" >
    <button  class="btn btn-default dropdown-toggle ladda-button"  data-style="expand-right"  aria-expanded="false"  data-toggle="dropdown"  type="button" >
    <i  class="fa fa-cog fa-fw" > </i>
    <span  class="caret" > </span>
    </button>
    <ul  class="dropdown-menu"  role="menu" >
    <li  class="li-info" >
    <a  class="action info"  attr="203-Info"  href="#" >
    <i  class="fa fa-info fa-fw text-info" > </i>
    <span  class="text-info" >
    <strong > Information</strong>
    </span>
    </a>
    </li>
    <li  class="li-email" >
    <a  class="action email"  attr="203-Email"  href="#" >
    <i  class="fa fa-envelope fa-fw text-warning" > </i>
    <span  class="text-warning" >
    <strong > Email</strong>
    </span>
    </a>
    </li>
    <li >
    <li >
    <li >
    </ul>
    </div>
    </td>

JS

  1. $(".dataTable tbody").on("click", "tr td .action", function(event) {
  2.         event.preventDefault();
  3.         LaddaSpinner = $(this).closest("button").ladda();
  4.         LaddaSpinner = $(".dataTable tbody tr td .action").closest("button").ladda();
  5.        LaddaSpinner.ladda("start");
  6.        
  7.         $(this).closest("div").addClass("btn-primary");
  8.         LaddaSpinner = $(this).closest('div [type="button"]').ladda();
  9.         LaddaSpinner.ladda("start");