Seems like this is a pretty common error, but being that I'm new to this I have no idea how to actually fix it. It's suppose to change the text on the page to what's in the input box once I click the button. Files are in the right directories so I know that's not the problem. HTML Code:
<!doctype html>
<html>
<head>
<title>Learning JavaScript</title>
<meta charset="utf-8" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<script type="text/javascript" src="JS/index.js"> </script>
</head>
<body>
<input id='myInput' type='text' value='test' />
<button id='stylesChanger'> Change the text!</button>
<div id='firstDiv'>This is some text </div>
</body>
</html>
Javascript Code:
var newText=document.getElementById("myInput").value;
document.getElementById("stylesChanger").onclick=function() {
document.getElementById('myInput').value;
document.getElementById("firstDiv").innerHTML=newText;
}