This article is a mirror article of machine translation, please click here to jump to the original article.

View: 9405|Reply: 0

[Jquery] jQuery hide doesn't work two solutions

[Copy link]
Posted on 2022-4-17 10:32:58 | | | |
Requirements: Using jQuery's hide method cannot make the div hidden, although the inline style has a higher priority than the outer style, but the display value of the div's class style uses !important, resulting in the call of hide even though display:none is set, as shown in the figure below:



Force !important to hide elements

The jQuery code looks like this:



Remove the original class attribute value

You can also solve the problem by calling the hide method and then removing the original class attribute value, the jQuery code is as follows:


(End)




Previous:Encoding URLs and parameters in JavaScript
Next:Prevent CSRF attacks on the cookie's SameSite property
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com