I´m trying to change the background image of a <div> by moving to another passage.
I want to use javaScript to do so, mostly because I´m using this as an exercise to learn html, css and javascript.
The code I got is the following:
So I assume .style isnt the right way to get that image in twine, I cant find anything regarding that though.
Also I would like to have the script in an external file but from what I read on here that is not possible?
I saw some solutions with jquery, but I just want to use my own locally stored scripts.
Any ideas?
Thanks in advance!
I want to use javaScript to do so, mostly because I´m using this as an exercise to learn html, css and javascript.
The code I got is the following:
the div id and path is all correct but I get this error: "Cannot read property 'style' of null"document.getElementById('con_area_id').style.backgroundImage="LocArray[0].bg";
So I assume .style isnt the right way to get that image in twine, I cant find anything regarding that though.
Also I would like to have the script in an external file but from what I read on here that is not possible?
I saw some solutions with jquery, but I just want to use my own locally stored scripts.
Any ideas?
Thanks in advance!