Little bit of a challenge question. What I have works though I'm no JS wizard, wondering if anyone has a better/preferred way of doing what I'm doing?Basically, I want to dynamically set a variable on focus, if it exists, and take the id/class/both of a particular form field to echo it in the tag so I can use that as a hook for styling.If anyone fancies a little Sunday challenge here you go:  $(function () {    $('input').focus(function() {      var use_id = $(this).attr('id');      var use_class = $(this).attr('class');      if (use_id) {        $('body').data('use_id', 'use_' + use_id);        $('body').addClass($('body').data('use_id'));      }      if (use_class) {        $('body').data('use_class', 'use_' + use_class);        $('body').addClass($('body').data('use_class'));      }    }).blur(function() {      if ($('body').data('use_id')) {        $('body').removeClass($('body').data('use_id'));        $('body').removeData('use_id');      }      if ($('body').data('use_class')) {        $('body').removeClass($('body').data('use_class'));        $('body').removeData('use_class');      }    });  })
jQuery focus/blur pass variable cleanup challenge
javascript;jquery