Help with some code, I'm stuck

Hi Guys,

Hope someone can help.

Im trying to get the below site working. https://foxwebbdesign.wixsite.com/choicecarsuk/our-fleet

When I click on one of the tabs this would show a picture below. This is the code I have so far. please bear with me if its rubbish or some glaring obvious mistakes, the sis my first go at any sort of JavaScript.


export function RegCar_onClick(event) {
$w(‘#RegCarPic’).show();
}

const CarPics = {
RegCar: “#RegCarPic”,
MiniBus: “#MBpic”,
WCA: “#WCApic”,
Exec: “#ExecPic
}

const carnames =[‘RegCarPic’, ‘MiniBus’, ‘WCA’, ‘Exec’];

function showCar(carname) {
$w(CarPics).src = CarPics[carname];
// hide the selection buttons for other colors
carnames
.filter(_ => _ !== carname)
.forEach(_ => $w(#${_}Selected).hide());
$w(#${carname}Selected).show();
}

export function RegCar_onclick(event) {
//Add your code for this event here:
showCar(‘#RegCar’);
}


Any help that anyone can give me or some advice would be very much appreciated.

Thanks,
Keir.