JavaScript allows us to retrieve an element by its id using the following syntax:
var x = document.getElementById("by_id");
I attempted to get an element by class with the following code:
var y = document.getElementByClass("by_class");
Unfortunately, this resulted in an error:
getElementByClass is not a function
Is there a way to obtain an element by its class?