JSFiddle - React, Tailwind, and code Playground

HTML

<a href="javascript:;" id="clickMe">click me</a>
<div id="changeMe"></div>

CSS

div {
    background-image: url(http://placehold.it/200x200);
    background-repeat: no-repeat;
    height: 200px;
    width: 200px;
}

JavaScript

$('#clickMe').on('click', function() {
    $('#changeMe').css('background-image', 'url(http://placehold.it/200x200/ff0000)');
})