You can use document.querySelector to get a reference to the <div> element and then update it's style attributes.
// querySelector can use CSS selectors to find the element in the document
// note: this is assuming there is only 1 element on page with this class
var myDiv = document.querySelector('.class1');
// Style properties generally match CSS but camel cased
myDiv.style.backgroundImage = 'url("https://hello.com/an-other-image.jpg")';
You may want to consider adding an id in which case you can use an ID selector or document.getElementById.
If there are multiple elements you want to update, you can use document.querySelectorAll which will return an array of matches which you can loop over and change.
function changeToAnotherBgImage(element) {
element.style.backgroundImage = 'url("https://hello.com/an-other-image.jpg")';
}
// Plenty of alternate ways of writing, arrow function may be appropriate
document.querySelectorAll('.class1').forEach(changeToAnotherBgImage);