JQuery - Element Selection
- by user208662
Hello,
I'm relatively new to JQuery. I'm trying to understand how to select a child element. Currently, I have some HTML that is defined as follows:
<div id="elem1">
<div class="display">Student 1</div>
</div>
<div id="elem2">
<div class="display">Student 2</div>
</div>
<div id="elem3">
<div class="display">Student 3</div>
</div>
When a user clicks a link, one of the elements (elem1, elem2, or elem3) is going to be passed to a function that is defined as follows:
function getNodeDisplay(node) {
// NOTE: This does not work as desired
return $(node).(#".display").html();
}
Unfortunately, this approach does not work. How do I get the HTML associated with an element that has a specific class or a given element? Thank you for your help!