Mus Harlem
Mus Harlem

Reputation: 175

How to start a link when entering page?

I have this link on my web page:

<a id="demo03" href="#modal-03">DEMO03</a>

How can I make that link run automatically, when I enter my page?

Hope you can help me!

Thanks :-)

Upvotes: 0

Views: 51

Answers (1)

Aju John
Aju John

Reputation: 2234

Try like this

<html>
    <head></head>
    <body>
        <a id="demo03" href="#modal-03">DEMO03</a>
        <script type="text/javascript">
            (function() {
                var link = document.getElementById('demo03');
                link.click();
            })();
        </script>
    </body>
</html>

Upvotes: 3

Related Questions