I am trying to figure out why it is working for text and not for images. When I try displaying "some text here" instead of the image tag in the div with id image box it works. In theory I should be able to insert an image using innerHTML
<!DOCTYPE html>
<html>
<head>
<link rel = "stylesheet" href = "jumai.css">
<link rel = "stylesheet" href = "bootstrap.css">
</head>
<body>
<div class = "container">
<div class = "col-md-2">
<p> Some text here </p>
</div>
<div class = "col-md-8">
<div class = "middlemenu">
<ul class = "list">
<li> <button type = "button" class = "btn btn-default" onclick=
"myfunction()"> BESTSELLER BRANDS </button> </li>
<li> <button type = "button" class = "btn btn-default">TRENDING NOW
</button>
</li>
<li> <button type = "button" class = "btn btn-default">SHOP NAIJA BRANDS
</button> </li>
</ul>
</div>
<div id = "imagebox" >
</div>
</div>
<div class = "col-md-2">
<p> sOME TEST HERE </p>
</div>
</div>
<script>
function myfunction(){
document.getElementById('imagebox').innerHTML =
" <img src = "infinix.png" alt = "infinix">";
}
</script>
</body>
</html>