JQuery change background not working

JQuery change background not working

Dear Sir/Madam

please refer 


We are listing Activity (Each activity has 2 options Yes , No)
viz 
Income Tax has 2 options Yes or No 
GST            has 2 options Yes or No 
------------------------------------------------------------------------------------

when clicked on Option No
We want to change 
1. for item clicked we want to  (NO is clicked)
  •  color of the text to white 
  • background color to   #9C1041
2. For Option Yes (currently green background and white text)
     we want to change to 
  • color of the text to #222
  • background color to #fff (white)
Jquery used

when option NO is clicked

following function is called after updating database table
(the database table is properly updated)

  1.  $('#updatediv'+updatedivid).load(url,data,servicedivcolorno(onlyid, thisid))  ; 


We are displaying the values passed

  1. function servicedivcolorno(onlyid, thisid){
  2. alert('function servicedivcolorno   values passed'+onlyid+' thisid='+thisid);
  3.    
  4.     $('#'+thisid).css("background-color", '#9C1041');
  5. $('#'+thisid).css("color", '#fff'); 
  6. $('#servicedivyyes'+onlyid).css('background-color', '#fff');
  7. $('#servicedivyes'+onlyid).css('color', '#222');
  8. }

when option YES is clicked


following function is called after updating database table
(the database table is properly updated)

  1.  $('#updatediv'+updatedivid).load(url,data,servicedivcoloryes(onlyid, thisid))  ; 


We are displaying the values passed


  1. function servicedivcoloryes(id, thisid)
  2. {   alert('function servicedivnocolor YES values passed'+id+' thisid='+thisid); 
  3.   
  4.     
  5. $('#'+thisid).css('background-color', '#086223');
  6. $('#'+thisid).css('color', '#fff');

  7. $('#servicedivno'+id).css('background-color', '#fff');
  8. $('#servicedivno'+id).css('color', '#222222');
  9. }