JSFiddle - React, Tailwind, and code Playground

by softvar

HTML

<div id="a1">abc</div>
<button>dd</button>
<div id="a2">abc</div>
<div id="a3">abc</div>
<div id="a4">abc</div>
<div id="a5">abc</div>

CSS

#a1{
    color:red;
    position:fixed;
}
#a2{
    color:green;
}
#a3{
    background:yellow;
}
#a4{
    background:green;
    color:red;
}
#a5{
    color:blue;
}

JavaScript

$(function(){

    
    function walk(elm) {
    var node;

    // ...handle this element's `style` or `getComputedStyle`...

    // Handle child elements
    for (node = elm.firstChild; node; node = node.nextSibling) {
        if (node.nodeType === 1) { // 1 == Element
            console.log($(node).css("position"));
            walk(node);
        }
    }
}

// Kick it off starting with the `body` element
walk(document.body);
    
});