Question on how to code JavaScript

Have actually been trying to use my js code to manipulate my css. Like have been trying to get the value of a element I styled with my css but it not work. Have also tried something like
’ if(the element === the style) {
Do this
} ’
Please can any one tell me what’s wrong

You are going to have to supply much more information here. What exactly are you trying to do and what exact code have you written?

This is one example:

if(document.getElementById("myelementID".style.display == "block"){
Do something
else {
Do something else

You are not using getElementById correctly. It would be something more like:

if(document.getElementById("myelementID").style.display == "block"){
1 Like

However, if you have styled anything with CSS, you should look into using getComputedStyle to access an element’s calculated style.

Didn’t pay attention, thanks for rectifying…