title: jQuery to remove a button from footer navbar
body: <p>Using jQueryMobile 1.4.5, I need to toggle the presence of the middle button on and off so that the other 2 buttons butt_up against each other if the middle button is gone.<br>
  My js script makes it disappear but leaves room between the ouster 2 buttons.<br>
  How can this be achieved?  Thanks</p>
  
  <p><a href="https://i.stack.imgur.com/aEL9R.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aEL9R.png" alt="enter image description here"></a>
  <div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>jQuery.fn.invisible = function() {
      return this.css('visibility', 'hidden');
  };
  
  jQuery.fn.visibilityToggle = function() {
      return this.css('visibility', function(i, visibility) {
          return (visibility == 'visible') ? 'hidden' : 'visible';
      });
  };
  
  $("li:nth-child(2)").invisible();</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>      &lt;footer data-role="footer" data-position="fixed"&gt;
           &lt;div data-role="navbar"&gt;
              &lt;ul&gt;
                 &lt;li&gt;&lt;button type="submit" data-theme="c"&gt;NO&lt;/button&gt;&lt;/li&gt;
                 &lt;li&gt;&lt;button type="submit" data-theme="c"&gt;EXTRA&lt;/button&gt;&lt;/li&gt;
                 &lt;li&gt;&lt;button type="submit" data-theme="c"&gt;YES&lt;/button&gt;&lt;/li&gt;
              &lt;/ul&gt;
           &lt;/div&gt;
        &lt;/footer&gt;&lt;!-- footer --&gt;</code></pre>
  </div>
  </div>
  </p>