Change btn color back to original when dropdown menu is empty
<p>Once a user clicks atleast 1 option from my dropdown menu, then the button colours change. Now when the user deselects ALL options (so that there are zero selected options), then I want the button colours to automatically change back to their original colours. Is that possible to achieve?
I tried working with if-else, but it didnt work. P.S. the user can deselect either unchecking each option box or use the "clear" button which clears all.</p>

<pre><code>var i = $("li").index( $(this).parent() );

  if ( i === 1 ) {
    $('btn_clear').css('background', 'blue');
  } else if ( i === 2 ) {
</code></pre>

<p>Here is my BOOTPLY ... <a href="http://www.bootply.com/nAupRgzzAp" rel="nofollow">BOOTPLY</a></p>