Clicar em botão ao carregar página
Olá pessoal,
Queria que uma página ao carregar, clicasse automaticamente em um link. Mas não está dando certo, segue o código:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Title of the document</title>
</head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function() {
$('#openNew').click();
});
</script>
<body>
<a id="openNew" href="http://www.example.org">Click me</a>
</body>
</html>
Alguém sabe porque ??Discussão (3)
Carregando comentários...