Sadece onfocusout
, onfocusin
hakkında öğrendim, ancak bu işlevler işe yaramıyor. İkisini de firefox ve krom ile denedim. Odaklandığımda ve gevşettiğimde bile hiç konsol mesajı yok. Neyi yanlış yapıyorum? Eğer sayfa durumu hakkında merak ediyorsanız olay ismionfocusout/onfocusin çalışmıyor
function example(evt) {
console.log(evt.type, event.target.id);
}
window.addEventListener("focusin", example);
window.addEventListener("focusout", example);
<input type="text" id="foo" />
<input type="text" id="bar" />
ile "açık" kullanmayan addEventListener ile
window.addEventListener
(
"onfocusout",
function()
{
console.log("page lost focus");
}
);
window.addEventListener
(
"onfocusin",
function()
{
console.log("page has focus");
}
);
<h1>Test</h1>
“Focus” ve “blur” olayları hakkında konuştuğunuz alan? –
Buradan bakın: http://www.w3schools.com/jsref/event_onfocusin.asp ve buradan http://www.w3schools.com/jsref/event_onfocusout.asp – Black
@RubyRacer https://developer.mozilla.org/tr -US/docs/Web/Olaylar/focusin – epascarello