Home > DeveloperSection > Forums > Jquery Help needed in changing color in condition
Takeshi Okada
Takeshi Okada

Total Post:89

Posted on    May-11-2013 3:16 AM

 JQuery JQuery 

 1 Reply(s)
 901  View(s)
Rate this:
Hi Expert!

I want a jQuery snippet for changing color of a button on condition--> I am using woocommerce with WordPress. What I want is : if there is Cart item is 0 then I want 

to show red color and if any item in cart then the button goes green

Please Help!

Thanks In Advance


Total Post:604

Posted on    May-11-2013 9:59 AM

Hi Takeshi!

Put your item number in a div/span and give an id. For example I took 'item_container' is the id of that div then:

   var item_nu = $('#item_container').html().parseInt();
       //write your code here to make the button red
       //write your code here to make the button green

Don't want to miss updates? Please click the below button!

Follow MindStick