使用HTML DOM实现对订单表格的增删改操作--前端小练
项目演示
1、
新增加功能 时间显示
点击 添加订单 会不断出现新内容
可以修改内容 删除内容
2、代码
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>订单</title>
<style type="text/css">
body{
font-size:15px;
line-height:20px;
}
table{
border-top: 1px solid;
border-left: 1px solid
}
td{
background-color: bisque;
border-right: 1px solid;
border-bottom: 1px solid;
text-align:center;
}
</style>
<script type="text/javascript">
//值小于10时,在前面补0
function dateFilter(date){
if(date < 10){
return "0"+date;}
return date;
}
function fun_clock()
{
var today = new Date();
var year = today.getFullYear();
var month = today.getMonth()+1;
var date = today.getDate();
var hour = today.getHours(); //获得小时、分钟、秒
var minute = today.getMinutes();
var second = today.getSeconds();
var apm="AM"; //显示上午: AM
if (hour>