<style>
#dv1 {
width: 100px;
height: 100px;
background-color: rgb(232, 121, 217);
}
#dv2 {
width: 10px;
height: 10px;
background-color: black;
float: right;
}
</style>
</head>
<body>
<div id="dv1">
<div id="dv2"></div>
<p>我真帅</p>
</div>
</body>
<script>
let dv1 = document.getElementById("dv1");
let dv2 = document.getElementById("dv2");
dv2.onclick = function () {
dv1.style.display = "none";
};
</script>