Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

On Click Image Doesn't Work

I made a script with an image and a javascript function but it doesn't work. It should redirect to www.moseso.de when you click the image. What's wrong with it?

<html>
    <head>
        <title>Hallo</title>
    </head>
    <body>
        <img src="test.jpg" onclick="func" />
        <script>
            function func() {
                window.location="www.moseso.de"
            }
        </script>
    </body>
</html>
like image 558
Manne Moses Avatar asked Mar 25 '26 08:03

Manne Moses


1 Answers

try setting:

onclick="func();"

also close the statement:

window.location="www.moseso.de";
like image 100
Evgeny Lukiyanov Avatar answered Mar 26 '26 22:03

Evgeny Lukiyanov



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!