Answers for "how to call image in javascript"

1

execute js from image

<div onclick = "ShowKeyboard()">
<img src = "' + content + '" alt ="Heads" height="170" width="170"/>
</div>
Posted by: Guest on March-06-2020
0

show image javascript

JS:
function setImageVisible(id, visible) {
    var img = document.getElementById(id);
    img.style.visibility = (visible ? 'visible' : 'hidden');
}

HTML:
<img id="myImageId" src="yourImage.png">
Then, your links would be:
<a href="javascript:setImageVisible('myImageId', true)">show image</a>
<a href="javascript:setImageVisible('myImageId', false)">hide image</a>

CSS:
#theImage { visibility: hidden; }
Posted by: Guest on January-30-2021

Code answers related to "how to call image in javascript"

Browse Popular Code Answers by Language