I have an html element that I want to hide from view, but I can’t access that element by an ID because it has no ID and I can’t assign an ID to it. It has a class assigned to it though. Is there any possible way to hide this element from view without having it’s id?
Share
There’s
getElementsByClassNamein some browsers, but it’s not as widely supported asgetElementById. Note that it yields an array of elements, instead of just a single element, as several elements can have the same class.If you can assign an ID to a parent you might be able to access it in some other way: