Wednesday, September 27, 2023
HomeCSSjavascript - getComputedStyle not upgraded after design upgrade

javascript – getComputedStyle not upgraded after design upgrade


I simply saw that when you do

 const img = document.querySelector(' img');
const display screen = window.getComputedStyle( img). display screen;// -> > 'obstruct'.
console.log( display screen);
img.style.display='inline-block'.
const upgrade = window.getComputedStyle( img). display screen;// -> > 'obstruct'.
console.log( upgrade);
<< img src=" http://placekitten.com/100/100" alt="">>

???

So, if I alter a block component to inline-block component, the getComputedStyle still returns block Nevertheless, when I make use of the. worth none as opposed to inline-block the getComputedStyle is upgraded and also returns none

The practices of getComputedStyle does not make any kind of feeling. Can somebody discuss to me what is taking place below (or provide me a web link where I can find out more regarding this!)

Update: I have to admit that when I attempt to replicate it does without a doubt job ( stackblitz) However when I do this in devtools

enter image description here

I continues to be the exact same

RELATED ARTICLES

Most Popular

Recent Comments