<!DOCTYPE html>
<html>
<head>
    <title>JavaScript Page</title>
    <script>
        function changeText() {
            document.getElementById('myText').innerHTML = 'The text has changed!';
        }
    </script>
</head>
<body>
    <div>
        <p id='myText'>Hello World!</p>
        <button type='button' onclick='changeText()'>Change Text</button>
    </div>
</body>
</html>

原文地址: https://www.cveoy.top/t/topic/llk5 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录