I want to tget an element from the DOM with the class "TextInput-fragment". There is only one on the page. I can find it by class name, getting a collection. But I cant access it through indexing.
let x = document.getElementsByClassName("TextInput-fragment");
console.log(x);
console.log(x[0]);
In the first line we clearly see the element at index 0. But accessing it through x[0] gives me an undefined. x.length returns 0. How to get this element?