css keep focus color on div after click

65

button.selected{
  color:red;
}
$('button').on('click', function(){
    $('button').removeClass('selected');
    $(this).addClass('selected');
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

<button>Item</button><button>Item</button><button>Item</button>
  

Comments

Submit
0 Comments