I tried to upload image by JS
but I could not do it through onload
, it follows the code I tried:
HTML:
<img class="razer" id="imageoption" onload="imageOption()">
JS:
document.onload = function imageOption() {
document.getElementById("imageoption").src = "images/hyperx-option.png"; }