Try this:
var clicked = 0
$("#button").click(function() {
if (clicked == 0) {
$(this).css("background", "url(https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQm19_RGu6ZbKhn_uryzGqZLIldxuLIYX-m6A&usqp=CAU) no-repeat");
clicked = 1;
} else {
$(this).css("background", "url(https://lesspestcontrol.com.au/wp-content/uploads/green-tick.png) no-repeat");
clicked = 0;
}
})
.button {
width: 250px;
height: 250px;
background: url(https://lesspestcontrol.com.au/wp-content/uploads/green-tick.png) no-repeat;
cursor: pointer;
border: none;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<html>
<head>
</head>
<body>
<input id="button" type="button" name="button" value="Search" class="button" />
</body>
</html>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…