should work … which has been your last choice.
if it does not and both the element and the jpg exist your element is not of kind img … or yes of course: you didn’t load jquery
Thanks a lot for your answer.
When i insert a image, i got an element which is a simple div and not an img because the background color is not a color but an image. How to import an image and to get an image ?
hard to follow on what you are doing.
are you trying to assign a backgroundimage to a widget¿ this does not work …
otherwise the console may give a good hint … just have a look for the error messages
Have you considered using a built-in Hype approach instead of code?
You can have the click run a timeline, and that timeline can have keyframes which change the image. The background image is an animatable property - you can hit record, advance the playhead, then use the ‘choose’ button in the background inspector item to have a new keyframe be inserted.
Otherwise, a few issues would be that if you’re doing this from a HTML Widget, you should know that these are iframes, and cannot be communicated to in the same way that you would a regular element. If you need programmatic control to arbitrary HTML, it is much easier to start with a Rectangle element modify via ‘Edit > Edit Element’s Inner HTML’.