Question:
When I execute this code, the console returns “undefined”.
$w('#image1').onClick((event) => {
const clickedElement = event.target;
console.log(clickedElement.style);
clickedElement.style.backgroundColor = 'blue';
clickedElement.style.borderWidth = 22;
});
Product:
Editor X I think
What are you trying to achieve:
Changing the style of the clicked image
What have you already tried:
This:
$w('#image1').onClick((event) => {
const clickedElement = event.target;
console.log(clickedElement.style);
clickedElement.style.backgroundColor = 'blue';
clickedElement.style.borderWidth = 22;
});