用户:ray_crazy查看:1 回复:3 评论:1 创建时间:2020-05-08T17:51:30
<!DOCTYPE html>
<head>
<title></title>
<style></style>
<script>
window.onload = function(){
var add = document.getElementById("add");
var set = document.getElementById("set");
var delet = document.getElementById("delet");
var submitButton = document.getElementById("submitButton");
add.onclick = function(){
windownow = document.getElementById("Window-add");
windownow.style.display = "block"
}
submitButton.onclick = function(){
name = document.getElementById("nameBox").value;
time = document.getElementById("timeBox").value;
alert("提交成功");
alert("名字:"+name+"|时间:"+time);
windownow.style.display = "none";
}
}
</script>
</head>
<body>
<div class="buttonTop" style="text-align: right;">
<button id="add"></button>
<button id="set"></button>
<button id="delet"></button>
</div>
<div id="Window-add" class="Window-add" style="text-align: center;display: none;">
<div style="display: inline-block">
<span>名字name:</span>
<input id="nameBox" type="text">
<br>
<span>时间time:</span>
<input id="timeBox" type="time">
<br>
<button type="submit" id="submitButton" style="width:300px;height: 80px;"><h1>提交</h1></button>
</div>
</div>
</body>
是.html的文件格式,用浏览器打开,点击右边第一个按钮,就可以创建拉!啥也干不了,有改编的发到评论区,按钮图片没加,表单展示没加,删除没加,………………没加
蒟蒻OIer1048576我也来晒的(我的编程学习的一部分)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>test</title>
<script>
var now = new Date();
function setColor(){
now.setTime(now.getTime()+1000);
time = now.toTimeString();
var hour = time.split(":")[0];
if((hour > 6 && hour < 11) || (hour > 13 && hour < 19)){
document.getElementById("color").style.backgroundColor = "dodgerblue";
}
else if(hour > 10 && hour < 14){
document.getElementById("color").style.backgroundColor = "lightskyblue";
}
else if(hour > 18 && hour < 22){
document.getElementById("color").style.backgroundColor = "blue";
}
else{
document.getElementById("color").style.backgroundColor = "darkblue";
}
document.getElementById("loading").innerText = '';
}
setInterval("setColor();",1000);
</script>
<style>
.button{
color: white;
font-size: 40px;
}
.button:hover{
color: black;
}
</style>
</head>
<body >
<div style="width: 100%; height: 100%;" id="color">
<p id="loading"></p>
<header>
<div style="width: 100%;height: 200px;">
<img src="">
<div style="text-align: center;color: white;">
<h1>欢迎来到代码课堂</h1>
<p>By lai-1048576</p>
</div>
</div>
</header>
<div style="text-align: center;">
<a class="button" href="print.html">☞Hello World与简单输出</a>
</div>
</div>
</body>
</html>
点赞0
评论