JSFiddle - React, Tailwind, and code Playground

by aprilkw

HTML

<div>The top
    <div>A child</div>
    <div>A sibiling of that last child
        <div>Another baby</div>
    </div>
</div>

JavaScript

//alert(document.body.firstElementChild.firstElementChild.textContent)

//alert(document.body.firstElementChild.firstElementChild.nextElementSibling.firstElementChild.textContent)

//alert (document.body.innerHTML);

//alert (document.body.firstElementChild.firstElementChild.innerHTML);

//alert (document.body.firstElementChild.firstElementChild.nodeName);

if (document.body.firstElementChild.firstElementChild.nodeName === "p"); {alert("This is p")};

//alert(document.body.textContent);

//window.open("http://google.com");