I'm trying to create a page that can be influenced by another page if that makes sense (one page control what happens on the other page...).
I have two HTML pages and one js file named "Controll.js" and in that there is a function to change "Indiv" in the Index.html. This event is triggered by the button on the Controll.html page. My code is below: (the js is the referenced Controll.js file)
function myFunction() {
document.getElementById("Indiv").innerHTML = "Hi!!";
}
<!-- Controll.html -->
<DOCTYPE! html>
<head>
</head>
<body>
<button type="button" onclick="myFunction()">write hi</button>
</body>
<script src="Controll.js"></script>
</html>
<!-- END Controll.html -->
<!-- Index.html -->
<DOCTYPE! html>
<head>
<script src="Controll.js"></script>
</head>
<body>
<p id="Indiv"></p>
</body>
</html>
<!-- END Index.html -->