I looked around for an answer to this but have been unsuccessful so far. What I have is a div containing radio buttons with titles
<div>
<label title_id="1" function="update_answer_title" class="pure-radio" for="option-1">
<input type="radio" name="1" value="1" id="option-1">
Talking on the phone or sending a text message.
</label>
<label title_id="2" function="update_answer_title" class="pure-radio" for="option-2">
<input type="radio" name="1" value="2" id="option-2">
Having your keys held in your hand, ready to unlock car and/or provide defense.
</label>
</div>
Now what I am trying to do is get the text inside a label when that label is clicked. Not the html of the radio button. So inside my onclick listener I am What I have tried so far is:
evt.target.childNodes[1].valueOf().innerText
evt.target.childNodes[1].toString()
JSON.stringify(evt.target.childNodes[1])
And a bunch of other permutations of these attempts. but each time all I get from that value that these are returning is:
[object Text]
How do I convert object Text to normal text?
Thank you!