Element Selection
Old School
Selecting an element by id
document.getElementById('login');<input id="login">Select using CSS class
document.getElementsByClassName('blog-post');<section class="blog-post-content"></section>Select by HTML tag
document.getElementsByTagName('header')<header>This is the header.</header>Modern Way
Select using query selector
Last updated