Saved X
Google login
SignUp with Email
X

Create link and click javascript

theindreshverma ( Edited  Sep 29, 03:27 pm )
Login

Javascript click() method

<html>
<head>
    <title>Create link and click javascript</title>
</head>
<body>

<h1>Create link and click javascript</h1>

<p id="l"></p>

<script>
function createLink() {
    var x = document.getElementById('l');
    
    x.innerHTML = '<a href="#" id="link">Link</a>';
    
    document.getElementById('link').click();
}
createLink();
</script>

</body>
</html>

Sourcecode Tags

More Sourcecodes

More Sourcecodes