代码编辑器:
x
1
<p>点击按钮创建 Time 字段</p>
2
<button onclick="myFunction()">点我</button>
3
<script>
4
function myFunction() {
5
var x = document.createElement("INPUT");
6
x.setAttribute("type", "time");
7
x.setAttribute("value", "21:35:09");
8
document.body.appendChild(x);
9
}
10
</script>
11