使用JavaScript做灯泡开关的效果
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>灯</title>
<style>
#a1{
float: left;
}
#a2{
float: left;
}
#showTime{
overflow: auto;
}
</style>
</head>
<body>
<div id="a1">
<div><img src="dark.png" style="width: 450px;height: 550px" id="light"></div>
</div>
<div id="a2">
<div style=" margin-top: 400px;margin-left: 50px">
<img src="off.png" style="width: 100px;height: 150px" id="switch" onclick="oc()">
</div>
</div>
<div id="a" style="margin-left: 200px">
&