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]" );

No comments:

Post a Comment