Thursday, 12 September 2013

perform alert when seperate function is done using jquery

perform alert when seperate function is done using jquery

I have one function in page. I want to perform alert when changecolor()
complete action. But the problem is I cannot change in changecolor() due
to some restriction. So is there anyway to know that function is done. I
have attached demo fiddle
function changecolor(id){
$(id).css('backgroundColor','green')
}
changecolor().done(function(){
alert(0)
})