<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title></title>
<link href="./css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container">
<h1>请登陆</h1>
<form>
<div class="input-group">
<span class="input-group-text">@</span>
<input type="text" class="form-control" placeholder="用户名">
</div>
<div class="input-group">
<span class="input-group-text">@</span>
<input type="text" class="form-control" placeholder="密码">
</div>
</form>
<br/>
<button type="button" class="btn btn-primary">登陆</button>
<button type="button" class="btn btn-warning">取消</button>
</div>
<script src="./js/bootstrap.bundle.min.js"></script>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>灯泡开关</title>
</head>
<body>
<img id="light" src="./jsimg/off.gif" alt="">
<script>
var img = document.getElementById("light");
//开关
var flag = false;
img.onclick = function () {
//判断灯泡目前是开还是关
if(flag){
//灯泡是开的,把它变成关闭
img.src="./jsimg/off.gif";
flag = false;
}else{
//灯泡是关闭的,把它变成开的
img.src="./jsimg/on.gif";
flag = true;
}
}
</script>
</body>
</html>