Skip to content

Instantly share code, notes, and snippets.

@SitesByYogi
Created October 27, 2023 04:03
Show Gist options
  • Save SitesByYogi/7aa06f3fd115fd33e749cba3350c3253 to your computer and use it in GitHub Desktop.
Save SitesByYogi/7aa06f3fd115fd33e749cba3350c3253 to your computer and use it in GitHub Desktop.
remove class with js
function removeCSSVariableAndChangeColor() {
const selector = ".woocommerce div.product p.price";
const elements = document.querySelectorAll(selector);
elements.forEach(element => {
// Remove the CSS variable
element.style.removeProperty('--color-1');
// Change the color to #b3af54;
element.style.color = '#b3af54';
});
}
// Call the function to apply the changes
removeCSSVariableAndChangeColor();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment