<a class="link" href="#" data-img="img1.png">Link 1</a>
<a class="link" href="#" data-img="img2.png">Link 2</a>
<a class="link" href="#" data-img="img3.png">Link 3</a>
<div class="div1"></div>
var links = document.getElementsByClassName('link');
for (var i = 0; i < links.length; i++) {
links[i].addEventListener('hover', function() {
let img = links[i].getAttribute('data-img');
document.getElementsByClassName('div1')[0].style.background-image = img;
});
}
function required_checked_input1 (form, element) {
var notFilled = []
$(form).find(element).each(function () {
if ($(this).attr('data-required') == 'yes' && $(this).val() == '') {
$(this).addClass('not-filled');
notFilled.push($(this));
} else {
$(this).removeClass('not-filled');
}
})
return notFilled;
}