亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

javascript - Why are the margin values ??different between using native js to get the body and using jquery to get the body?
怪我咯
怪我咯 2017-07-05 10:42:07
0
2
966
console.log(document.getElementsByTagName("body")[0].style.margin)  空
        console.log($("body").css("margin"))  8px
怪我咯
怪我咯

走同樣的路,發(fā)現(xiàn)不同的人生

reply all(2)
黃舟

You can try to get width and the like, and the result will be ''

Because XXX.style.XXX extracts industry attributes

Because what you set through XXX.style.XXX is also an inline attribute, so you can get it this time

Then how to take out the attributes set with css

getComputedStyle(element).margin
迷茫

The two obtained tags <body> are the same, but the first attribute is overwritten and is empty, and the second one is not overwritten and is 8px.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template