0
点赞
收藏
分享

微信扫一扫

修改元素过程

彩虹_bd07 2022-06-16 阅读 81

 

 

<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>

 


举报

相关推荐

0 条评论