Jo Micheal
Published in : 2022-01-27
Hello everyone, I am facing an issue when I try to use CSS function using jQuery to set !important the code I am using is
jQuery("div.shipping_address").css({ "display": 'none !important' });
it adds the display: none; but without the !important What should I do to add it?
Thanks in Advance
Join our community and get the chance to solve your code issues & share your opinion with us
Sign up Now
Joseph Morgan Date : 2022-01-27
Best answers
11
Best answers
11
Welcome Back Jo,
Css function in jQuery doesn't support !important so the other way to do this is by adding using .attr like this code below
this gonna work with you also you can keep main style of the div by storing the attribute value in element then add it to the code above like
Good luck
Jo Micheal Date : 2022-01-27
Thank you this is really helpful