Hello, why is an element with a class starting with numbers not found when escaping? The element is not found when trying to find it in its parent element, as well as when trying to search generally in the document. The problem must be in the code in this case, since the element cannot be found in the document itself when the resulting class looks like “.\792o42ho1jo5”
These elements are created dynamically and therefore classes are also generated automatically. However, since the element being searched for already exists in the DOM tree at the time of searching, even directly through the document, the problem must be with the function. Even when there is no obvious error from the queryselector method that the specified selector is invalid, for example.
I don’t understand English and I use a translator, there are probably changes in the meaning of some words and we can’t really reach an agreement because of it.
probably. You say you are escaping a character, but numbers do not need to be escaped. Selector .\792o42ho1jo5 will select class="\792o42ho1jo5" . Is this what you want?
When I want to find an element using the queryselector method and its class starts with numbers, they must be escaped. I simply want to find an element using any class, but since the queryselector method does not accept a class that begins with numbers, it must be modified because this is how the browser interprets the selector incorrectly. The rest is logical, as in CSS itself you cannot use numbers at the beginning of the class, especially in the queryselector method. When I use numbers in a CSS class at the beginning, I receive, for example, the error “at-rule or selector expected”.