How does JavaScript get HTML elements by ID? (from Wanderlust project, but it's a general syntax question))

Could someone please explain this syntax, found in a .js file, relating to an ID in a .html file?

const $input = $('#city');

It’s obviously calling the page element, but I can’t find any general explanation of its use. Is it different from .getElementById?

1 Like

its jquery (a JS library). Good possibility that jquery is using getElementById under the hood.