KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Lets say that I have a HTML that looks like this: <div class="aaa"><span>1</span></div> <div class="aaa"><span>2</span></div> <div class="aaa"><span>3</span></div> <div class="aaa"><span>4</span></div> With $('.aaa span') I can select all span elements. With $('.aaa').each() I can iterate over the div elements. My question is how to select the span in each div from inside the each function like: $('.aaa').each(function(index, obj){ x = selector_based_on_obj // x equal to the current div`s span })
Tags (comma-separated)
Save Edits
Cancel