JSFiddle - React, Tailwind, and code Playground
HTML
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<li class="liwithdivider col-md-2 col-sm-2 active_class" style="background-image:none" id="toggleme">
<p class="this">
<img class="img-responsive header_li_image" style="display: inline; position: relative;" src="http://www.daru-koi.com/images/winkelwagen.png" width="40" height="40"> <span id="cartitems">
1 item </span>
</p>
</li>
CSS
.active_class {
margin-left:2px;
background-repeat:no-repeat;
background-size:365px;
color:#bdc746;
list-style: none;
background-image : url('http://cdn.mysitemyway.com/etc-mysitemyway/icons/legacy-previews/icons-256/simple-red-glossy-icons-business/086707-simple-red-glossy-icon-business-cart5.png');
list-style: none;
}
.this {
background-color: #fff;
margin-left:2px;
border-image: url("/assets/btn-border-yellow.png");
background-repeat:no-repeat;
background-size:365px;
color:#000;
list-style: none;
}
JavaScript
$(document).ready(function () {
var img=0;
$('#toggleme').click(function () {
$(this).toggleClass('active_class');
if(img==0){
$(this).find("img").attr("src", 'http://cdn.mysitemyway.com/etc-mysitemyway/icons/legacy-previews/icons-256/simple-red-glossy-icons-business/086707-simple-red-glossy-icon-business-cart5.png');
img=1;
}else{
$(this).find("img").attr("src", 'http://www.daru-koi.com/images/winkelwagen.png');
img=0;
}
});
});