jQuery focusin() Yöntemi

focusin() Yöntemi;

.focusin() yöntemi bir elemente odaklanınca ne yapılacağını belirtmek için kullanılır.

ipucu:Bu yöntem genellikle focusOut () yöntemi ile birlikte kullanılır.

Örnek

$("input").focusin(function(){
  $(this).css("background-color", "red");
});
$("input").focusout(function(){
  $(this).css("background-color", "yellow");
});

Codepen Ön izleme

 

Kullanım şekilleri;

.focusin(handler);

.focusin(eventData);

.focusin();