perform action using element state in jquery - Jquery

on focus in jquery

Snippet Code


  
Rate this page :
  [ 0 votes]

jQuery('form') .focusin(function(){ jQuery(this).addClass('focused'); }); .focusout(function(){ jQuery(this).removeClass('focused'); }); //However, the preferred way to do this is using // .focus() and .blur() //For when an element loses it's focus use .blur() $('

Tags


Ask Questions

Ask Question