<div class="parent">
<h1>Child</h1> <!-- h1:first-child, h1:first-of-type -->
<div>Child</div> <!-- div:nth-child(2), div:first-of-type -->
<div>Child</div>
<div>Child</div>
</div>
const ul = document.querySelector( 'ul' );
console.log( ul.firstElementChild );
console.log( ul.firstChild );
const ul = document.querySelector( 'ul' );
console.log( ul.firstElementChild );
console.log( ul.firstChild );
Code Example |
---|
Html :: open link in new tab |
Html :: html color crimson hex |
Html :: html select box |
Html :: what is iframe html |
Html :: javascript remove the current tr with click |
Html :: bootstrap 5 input group |
Html :: html link to download file |
Html :: bold html |
Html :: box search bootstrap |
Html :: How to generate a QR code in JavaScript? |
Html :: textarea html break line |
Html :: bulma css buttons |
Html :: how to include a dash in html |
Html :: tailwind css dropdown |
Html :: html code contact form template |
Html :: html video |
Html :: Prettier not formatting HTML files in VS Code |
Html :: Div and span |
Html :: java replace all html tags |
Html :: email |
Html :: js download File object |
Html :: click on button fire to another button |
Html :: bootstrap class width auto |
Html :: on click in a tag |
Html :: page break html |
Html :: embed xml in html page |
Html :: div side by side css without bootstrap |
Html :: sub html |
Html :: unix unexport environment variable |
Html :: blink html |