js替换div里的内容

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script>
function a(){
document.getElementById("a").innerHTML=111111;
}
</script>
</head>
<body>

<div id="a" onclick="a()">点我替换</div>

</body>
</html>

posted @ 2019-08-19 12:11  钧一  阅读(6912)  评论(0编辑  收藏  举报