0
How do I click a button on an html page, and in the other html page appear something with a single javascript file?
example below:
HTML 1
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Teste</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<button onclick="adicionar()">Teste</button>
<script src="main.js"></script>
</body>
</html>
HTML 2
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Teste</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div id="teste"></div>
<script src="main.js"></script>
</body>
</html>
JS
var ad = document.getElementById("teste")
function teste(){
ad.innerHTML += "Teste"
}
function adicionar(){
function teste()
}
that I wanted, every time I clicked on the button of an html page, to appear "test" on the other html page
I’m gonna come in here, vlw bro
– user199121