input text highlighter

If input test got input it should be get highlight, if not it removes the input box outline. Its general for all inputs like text, password, email

by Ayyappan Sakthivadivel

HTML

<input type="text" />

CSS

.pv-txt-hilt {
  border: #0f0 solid 1px;
}

JavaScript

$('input[type=text], input[type=password], input[type=email]').focus(function() {
    $(this).addClass('pv-txt-hilt');
  });
  $('input[type=text], input[type=password], input[type=email]').blur(function() {
    if ($(this).val() == '') {
      $(this).removeClass('pv-txt-hilt');
    }
  });