修改元素过程
<style> div { width: 300px; height: 30px; line-height: 30px; color: #fff; background-color: pink; } </style> <body> <button id="btn">显示当前时间</button> <div id="div">某个时间</div> <script> var a = document.getElementById("btn"); a.onclick = function () { div.innerText("123"); var a = prompt("1231"); div.style.backgroundColor = "red"; div.style.width = "500px"; div.style.height = "500px"; }; </script>

浙公网安备 33010602011771号