Q:

Why won't my HTML button run my JavaScript function?

What's wrong with the following HTML? When the button is pressed, it should change to "test text".
test.html
<!DOCTYPE HTML>
<html>
    <head>
        <title>Test</title>
        <script src="test.js"></script>
    </head>

    <body id="test">
        <button type="submit" class="btn" onClick="test()">test</button>
    </body>
</html>

script.js
function test(){
    document.getElementByID("test").innerHTML="test text";
}

A:

There seems to be a typo error. It should be as below:
document.getElementById("test").innerHTML="test text";

EDIT: You should check the point mentioned by Topro in the comments also. The script's src file name could also be an issue.

