Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot get my simple JavaScript function to work [closed]

Hi I am new to the site so I hope this goes well but I have an image and when I click on it I want a function to run to show a but no matter what I try it will not do anything... I am new to JavaScript so I assume something is wrong.

Can anyone help?

This is the JavaScript I am using between the tags!

<script type="text/javascript">
    function showLarge() {
    var largeFrame = document.getElementById(zoomedIn);
    largeFrame.style.visibility='visible';
    }
</script>

This is the HTML code:

<div id="zoomedIn" style="visibility:hidden">

<img src="Media//Gallery//img_1.jpg" onclick="showLarge();" alt="Gallery Image 1" />
like image 727
Mayron Avatar asked Nov 17 '25 00:11

Mayron


1 Answers

Perhaps

var largeFrame = document.getElementById("zoomedIn");

would work?

like image 183
Thomas Junk Avatar answered Nov 19 '25 13:11

Thomas Junk



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!