Skip to content
Advertisement

Change HTML item_status Class in javascript

Hello i have HTML below:

JavaScript

And then if my page was loaded and see the Sold text i want to change the:

JavaScript

To:

JavaScript

and if the code is:

JavaScript

Change to:

JavaScript

Thank you before

Advertisement

Answer

Just add class to your .item-status, if you use jQuery:

JavaScript

With pure javascript:

JavaScript

Update: Detect sold text With jQuery:

JavaScript

With pure Javascript

JavaScript
Advertisement