Javascript Reference - HTML DOM Input Time blur() Method








The blur() method removes focus from a time field.

Browser Support

The blur() method is supported in all major browsers.

blur Yes Yes Yes Yes Yes

Syntax

timeObject.blur() 

Parameters

None.

Return Value

No return value

Example

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: