Javascript will not overwrite CSS display property

I have a DIV that is set to display: none from CSS and it should be visible ( style.display = '';) at some point in javascript.

The problem is that if I put display:nonein a CSS file, javascript does not seem to have any effect. I also tried changing the background color instead of the display property, and this works.

I have the code here (just click on the edit link).

I really thank you for taking the time to look at this.

+3
source share
3 answers

Install it in blockor inlineusing Javascript.

style.display = "" display, , , CSS.

className Javascript, CSS .

+5

, style.display = '' . .

display:

style.display = 'block';

, , .

+4

Another way to hide the content is to use opacity=0and again visibleuse opacity=1thats it .... !!!

0
source

Source: https://habr.com/ru/post/1783037/


All Articles