JSFiddle - React, Tailwind, and code Playground
by MihayNagy
JavaScript
$('button').click(function (e){
if ($(this).html() == 'Купить') {
$(this).html('В корзине');
$(this).css({'background' : '#50c878',
'border' : 'none',
'color' : 'white'
});
}
});