0

Given HTML of

<div id="parent">
   <span class="child"></span>
   <span data-text=true class="child></span>
</div>

How can you retrieve specifically the <span data-text=true class="child></span> element?

var ele = document.getElementById("parent")
// ele.child...

Note - there are many of these parent elements on the page, so once you get one you want just the data-text that is a child of the element.

user2954587
  • 4,661
  • 6
  • 43
  • 101

0 Answers0