I want to use the div’s css properties for my js conditional statement.
I have this code of css :
div.desc{
position:relative;
top:0px;
left:0px;
}
now, I want to use it in my js so I try to alert the top.
alert(document.getElementsByClassName('desc')[0].style.top)
but I got the blank return.
Does my code done wrong? or it is possible that I can get the css property of the div class desc using js?
You can do it with jquery.