The blur()
method removes focus from a time field.
The blur() method is supported in all major browsers.
blur |
Yes | Yes | Yes | Yes | Yes |
timeObject.blur()
None.
No return value
The following code shows how to remove focus from a time field.
<!DOCTYPE html>
<html>
<body>
<!-- w ww . j a va 2 s. com-->
<input type="time" id="myTime" value="22:15:00">
<button type="button" onclick="getFocus()">Get focus</button>
<button type="button" onclick="loseFocus()">Lose focus</button>
<script>
function getFocus() {
document.getElementById("myTime").focus();
}
function loseFocus() {
document.getElementById("myTime").blur();
}
</script>
</body>
</html>
The code above is rendered as follows: