-2
I hid a div using a CSS file and then tried to check if the div was visible or not with Javascript, my code did not return anything.
Code used:
document.getElementById("load-content-endereco").style.display
Soon after I tried to add the CSS directly to the div, as follows:
<div id="load-content-endereco" style="display:none;">Conteúdo aqui</div>
And that way the code worked.
I tried to search the term on several websites and all used the same example, always adding CSS directly in the div with the attribute style
.
Basically I seek to take values and manipulate the CSS that are in CSS files inside and outside my server.
Could someone give me a light here? I appreciate!
face you have to make a logic, maybe with if Else to see if you are with
.style.display = 'none'
etc. Actually did not understand good what you really intend to do...– hugocsl
This answers your question? How to display/hide an element in Javascript
– Ricardo Pontual
I didn’t quite understand your question, could I explain it better, please?
– Lucas Módolo
I just need the amount
display
received at the time of verification. , I am setting this value in a CSS file (.../css/style.css
). I know by adding CSS directly to div with style attribute (style="display: none;"
) I’ll have my result. But this is correct?– Rosiel Victor