Showing posts with label javascript - getElementById(). Show all posts
Showing posts with label javascript - getElementById(). Show all posts

Wednesday, November 3, 2021

JAVASCRIPT - getElementById() vs querySelector()

Different methods for same task - find the item by its ID.
var progressBar = document.getElementById( "progress" );
var progressBar = document.querySelector( "#progress" );
var progressBar = document.querySelector( "[id=progress]" );