Looking at the “highlight” JQuery effect:
http://docs.jquery.com/UI/Effects/Highlight
You can change the background color of any DIV to fade in/out
However, the example is to “highlight” on a “click” event
$("div").click(function () {
$(this).effect("highlight", {}, 3000);
});
How can I programatically call the highlight method as though it was a function within my code (instead of activate on a ‘click’ event)?
As pointed by JorenB this will highlight all the div’s in your page.
If you only want to highlight one div like:
You should do:
If you want to highlight all div’s with a specific classe you cand do:
For more information on selectors see JQuery Selectors.