so i have this code
<div class="place-container">
<h1>PICK YOUR FAVOURITE</h1>
<p>Select the place you want to get a ticket</p>
<button class="btn-places" id="berlin">BERLIN</button>
<button class="btn-places" id="netherlands">NETHERLANDS</button>
<button class="btn-places" id="sweden">SWEDEN</button>
<button class="btn-places" id="italy">ITALY</button>
</div>
and i have right this code in js for selecting a button and a get a border
for (let i = 0; i < btnPlaces.length; i++) {
btnPlaces[i].addEventListener("click", function (e) {
let prevBtn = document.querySelector(".checked");
console.log(prevBtn);
if (prevBtn) {
prevBtn.classList.remove("checked");
e.target.classList.add("checked");
} else {
e.target.classList.add("checked");
}
});
}
css code
.checked {
border: 3px solid rgb(34, 34, 34);
}
now i want to make or add to the function , the ability to show different photos based on the buttons to a div. lets call it (col-1)
for example i click berlin button and in div col-1 it shows berlin.jpg but when i click sweden it will show sweden and not berlin