जब कोई तत्व फोकस खोना चाहता है तो ऑनफोकसिन ईवेंट ट्रिगर होता है। ऑनफोकसआउट . को लागू करने का तरीका जानने के लिए आप निम्न कोड को चलाने का प्रयास कर सकते हैं जावास्क्रिप्ट में घटना।
उदाहरण
<!DOCTYPE html>
<html>
<body>
<p>Write below:</p>
<p>After losing focus, the background color of input check will change.</p>
<input type = "text" onfocusout = "newFunc(this)">
<script>
function newFunc(x) {
x.style.background = "blue";
}
</script>
</body>
</html>