<!DOCTYPE html>
<html>
<head>
<script>
window.onload = function() {
var d = new Date();
var h = d.getHours();
var m = d.getMinutes();
var s = d.getSeconds();
document.getElementById("myTime").value = h+":"+m+":"+s;
};
</script>
</head>
<body>
<input type="time" id="myTime" />
</body>
</html>
2条答案
按热度按时间hwazgwia1#
9avjhtql2#
试试这个:
input[type=time]::-webkit-datetime-edit-ampm-field { display: none; }