+ 1
javascript changing background image
how can i change the background image of an element using javascript?i use document.getElementById(id).style.backgroundImage = "url(" insert url "); but the url uses an https: and that causes an error with the javascript console
2 Antworten
+ 3
Hi Tence Sailor have you tried using single quotes ' https' around the https?
+ 3
Make sure that url its valid. If its, post your console error and your browser name... Test your code on other browsers just for test