当我点击当前div的时候 当前div的背景变色 怎么实现?

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        div{
            width:80px;
            height:80px;
            border:1px solid #000;
        }
    </style>
</head>
<body>
<div class="aaa" id="p1">
    <span>111</span>
    <div class="aaa" id="p3">
        <span>2222</span>
        <div class="aaa" id="p2">
            <span>333</span>

        </div>
    </div>
</div>


</body>
</html>


19990000
浏览 1971回答 2
2回答

橋本奈奈未

-_-看你看了挺多课程的,难道是刷的?
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript