views:

1220

answers:

2

jQuery's highlight method will highlight any div with a yellow background.

How do I specify what color to use instead of yellow for highlight?

+11  A: 

According to the documentation:

$(this).effect("highlight", {color: 'blue'}, 3000);
Paolo Bergantino
+1  A: 
$("div").click(function () {
    $(this).effect("highlight", { color: "#ff0000" }, 3000);
});

will highlight in red. It's all in the documentation.

Tomas Lycken
color = will give a syntax error. the notation is key: 'value'
Paolo Bergantino
sorry - i was too wound up in anonymous c# types in my head... ;) edited!
Tomas Lycken
cheers guys. I was looking into the jqueryui documentation which is not as detailed as jquery's documentation
Hady