i have a class boxright with backgrround image of cave
i have a button which on onclick it points to function ontop() which reset the backgroundimage of boxright to an image cheetah
i want the cheetah to appear on top the cave, ie on buttonclick i want the cheeteh to appear inside the cave
How to achieve this?
function ontop()
{
var d=document.getElementById('a').style.backgroundImage="url(https://i.ibb.co/0DvMRj4/wcheetah.png)";
console.log(d);
}
.boxright {
position: absolute;
top: 48.3vh;
left: 50.98vw;
width: 14.0vw;
height: 40.0vh;
cursor:pointer;
border:2px solid black;
background-image:url(https://i.ibb.co/cYnc1Ky/kisspng-cave-euclidean-vector-illustration-vector-cave-5a7a360b205458-5617697615179586671324.png);
background-repeat:no-repeat;
background-size:cover;
}
<div class="boxright" id="a"></div>
<button onclick="ontop();">place another image indide cave</button>