অনফোকাসিন ইভেন্টটি ট্রিগার করে যখন একটি উপাদান ফোকাস হারায়। কিভাবে অনফোকাসআউট প্রয়োগ করতে হয় তা শিখতে আপনি নিম্নলিখিত কোডটি চালানোর চেষ্টা করতে পারেন জাভাস্ক্রিপ্টে ইভেন্ট।
উদাহরণ
<!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>