highlight text box border color for few seconds?

css, html, jquery

Solution

This little script added the class 'highlight' for two seconds to the input field:

$('#text').change(function() {
    var jElement = $(this);
    jElement.addClass('highlight');
    setTimeout(
        function() { jElement.removeClass('highlight'); },
        2000
    );
});

Also see this example.

Or here the combination of your and mine solution.

Problem

Hi i want to highlight a text box border color for few seconds , afterwards i want to change it back to white color. is ther a way for addClass function to specify time also. Any other way ?tried with http://jsfiddle.net/RW2s4/7/ not working

Original source