Skip to content

Conversation

@ahelmi365
Copy link

Since it is not recommended to use the same ID for multiple HTML elements on the same page, and since the purpose of an ID attribute is to uniquely identify a single element within an HTML document. Using the same ID for multiple elements would violate this principle and can lead to various issues. So considering this rule, the query() function will return one element with the give id #foo, which means that the for loop will iterate once. So I've changes the selector to be .foo (class selector) so we may get more than one element with the same class name "foo".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant