I'm building a website and I need to access an element with a specific class name from another element (all in a table) but I have used this class name within other groups.
<table>
<tr><th>Name</th></tr>
<div class="one">
<tr><td>Object 1</td></tr>
<tr><td>
<div class="hair">Black</div>
</td></tr>
<div class="two">
<tr><td>Object 2</td></tr>
<tr><td>
<div class="hair">Brown</div>
</td></tr>
</div>
</table>
How would I access the hair for solely Object 1 and console.log it? Everything works when it's not in a table but when I add the table tag, it doesn't work.
Could someone please provide a solution? Thank you so much!