I want to use a JavaScript variable which is equal to the url of an image in a html img tag. I need the following tag to be able to display the image that is tied to the variable.

```js
document.getElementById("id-of-img-tag").src = imgVar;

document.getElementById("id-of-img-tag").innerHTML = imgVar;
```

```html
<img id="id-of-img-tag" src=" " alt="img">
```

Both of the lines of JS result with the alternative being displayed for the img tag "img".