I'm trying yo change the background of a DIV, and I think that my code is correct, but it seems no. I think the error is on the URL parameter because without parameter the function works.
This is my code:
<script language="JavaScript">
function imagen(col){
document.write(col);
var elem = document.getElementById("fondo");
elem.style.backgroundImage = url('col');
}
</script>
<div class="grid-block" id="fondo" width: 100%; height: 100vh;">
<div class="heading">
<a href="pagina1.html" onMouseOver="imagen(uploads/banner-01.jpg)" >Rojo</a>
</div>
</div>
Thank you.