GetComputedStyle () indexiert gestrichelte Eigenschaften in Chrome nichtJavaScript

Javascript-Forum
Anonymous
 GetComputedStyle () indexiert gestrichelte Eigenschaften in Chrome nicht

Post by Anonymous »

getComputedStyle () listet die gestrichelten CSS -Eigenschaften in Chrom nicht auf < /p>
:root {
--test: #000;
}
< /code>
let cs = window.getComputedStyle(document.documentElement);
// works
console.log(cs.getPropertyValue('--test'));

// doesn't work
for (let i of cs) {
if (i.indexOf('--') == 0) {
console.log(i);
}
}
< /code>
https://jsfiddle.net/4kLv716o/
I read the docs (https://googlechrome.github.io/samples/ ... index.html) and I tried SO suggestions. I want to fix the above snippet for Chrome.

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post