I tried to use Jquery toggle event as following:
$("button:eq(2)").toggle(function(){
$(this).attr("style","background:red");},
function(){
$(this).attr("style","background:blue");},
function(){
$(this).attr("style","background:green");}
);
It could run properly if using jquery v1.6.1,But once changed to jquery latest version v1.9.1,it would throw followng exception:
Uncaught TypeError: Property 'function (){ $(this).attr("style","background:blue");}' of object # is not a function
Does anybody know this is caused by jquery bug or just because of the coding has some problem?