অনফোকাসিন ইভেন্টটি ট্রিগার করে যখন একটি উপাদান ফোকাস পেতে হয়। কিভাবে onfocusin প্রয়োগ করতে হয় তা শিখতে আপনি নিম্নলিখিত কোডটি চালানোর চেষ্টা করতে পারেন JavaScript-
-এ ইভেন্টউদাহরণ
<!DOCTYPE html>
<html>
<body>
<p>Write below:</p>
<input type="text" onfocusin="newFunc(this)">
<script>
function newFunc(x) {
x.style.background = "blue";
}
</script>
</body>
</html>