案例:javascript案例     状态:可编辑再运行    进入竖版
 运行结果 
x
 
1
<!DOCTYPE html>
2
<html>
3
<body>
4
5
<h3>演示如何访问 Local Datetime 字段</h3>
6
7
<p>点击按钮来创建 Local Datetime 字段。</p>
8
9
<button onclick="myFunction()">试一下</button>
10
11
<script>
12
function myFunction() {
13
    var x = document.createElement("INPUT");
14
    x.setAttribute("type", "datetime-local");
15
    document.body.appendChild(x);
16
}
17
</script>
18
19
</body>
20
</html>
21