1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
<button class="reportButtons">Awesome Button!</button> <style> .reportButtons{ margin:10px; background-color:#EFEFEF; border:none; padding:6px; } .borderClass{ border:1px solid red; } </style> |
1 2 3 4 5 6 7 8 9 |
$('.reportButtons').click(function(){ if( $(this).hasClass('borderClass') ){ $(this).removeClass('borderClass'); }else{ $(this).addClass('borderClass'); } }); |