How can I get an element by id, and then inside this element get all elements by class name using jQuery? It’s pretty easy to do this using the standard JS functions getElementById() and getElementsByClassName(), but unfortunately IE 7-8 do not support the latter.
Share
You have a few options:
The first, using a css selector:
Or using
find():Or using selector context:
It’s worth noting that using the context (final) approach causes jQuery to internally implement the
find()method.References:
find().