Skip to main content
Home / Code Snippets / jQuery Code Snippets / Highlight Related Label when Input in Focus

Highlight Related Label when Input in Focus

$("form :input").focus(function() {
  $("label[for='" + this.id + "']").addClass("labelfocus");
}).blur(function() {
  $("label").removeClass("labelfocus");
});
icon-link icon-logo-star icon-search icon-star