HTML/JS 站点在使用 javascript 时不会更新 html

HTML/JS site does not update html when using javascript

本文关键字:更新 html javascript JS 站点 HTML      更新时间:2023-09-26

我真的不知道我做错了什么,但我的网站就是不会更新标题的.innerHtml。浏览器控制台中没有错误,console.log() 返回正确的字符串 ("hhh")。id = test 和 teet 的两个元素都不会更新它们的 html

<html>
    <head>
        <title>
            test title
        </title>
    </head>
    <body>
        <h1 id="teet">TEST HEADING</h1>
        Search :
        <input id="input">
        <button onclick="load()" id="submit" type="button"> search </button>
        <br>
        <h1 id="test">  Test</h1>
        <script>
            function load() {
                var test = document.getElementById("test").innerHtml = "hhh";
                console.log(test);
            }
        </script>
    </body>
</html>

它是带有大写字母的内部HTML