Skip to content
Advertisement

Update image on button click

Can someone explain to me how do I update a property of an element from a function called from another element, like in the example below?
In this example, I created a flet app which shows 4 elements. The two elements at the top are images and the ones at the bottom are buttons. Now, I’d like to click the buttons and change the images. How do I do that? I already tried to change it through the controls, but I was not able to do it.

JavaScript

Advertisement

Answer

You need to update the value only of the Image.

Click on Load image to change the 2. image’s color:

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement