Currently, I am looking to update the background image url using JavaScript. Most tutorials I've come across involve having the image downloaded on the desktop and then providing its path. However, in my scenario, the user will input an image link which should be displayed within that specified URL.
let imglink = document.getElementById("img_link").value
document.getElementById("imgPreview").style.backgroundImage = 'url(' + imglink + ')'
I acknowledge that my code might seem incorrect and unconventional. I am seeking a proper solution on how to insert the link into the URL without resorting to overly complex coding as I am still at a beginner level and find it challenging to grasp advanced concepts.