Try this instead:
document.getElementById('imageDiv')
.innerHTML = '<img src="imageName.png" />';
Or you can create image element dynamically like this:
var par = document.getElementById('imageDiv');
var img = document.createElement('img');
img.src = 'put path here';
par.appendChild(img);
Note also that you should use single quotes or double quotes not ‘ character for strings.
So here is how your code should be:
var imgName = a === 'tick' ? 'tick.gif' : 'cross.gif';
document.getElementById('imageDiv')
.innerHTML = '<img src="' + imgName + '" />';
Or alternatively:
var imgName = a === 'tick' ? 'tick.gif' : 'cross.gif';
var par = document.getElementById('imageDiv');
var img = document.createElement('img');
img.src = imgName;
par.appendChild(img);
Or if you want apply your image to div background, then this is what you need:
var imgName = a === 'tick' ? 'tick.gif' : 'cross.gif';
document.getElementById('imageDiv').style.backgroundImage = 'url('+ imgName +')';
imageDivis a div, setting src for it will not display any image.