Skip to content Skip to sidebar Skip to footer

How Do I Access Childnode Of

<

Solution 1:

to change the label's text:

document.getElementsByClassName("mtb-ofr")[0].childNodes[1].nodeValue = 'something';

Solution 2:

getElementsByClassName returns an array. You need to first get the element from the NodeList.

document.getElementsByClassName("mtb-ofr")[0].childNodes[1].nodeValue

Solution 3:

Use jQuery !

$('label.mtb-ofr').children()

You're done !

And you can filter more by passing parameters to children().

http://api.jquery.com/children/

Post a Comment for "How Do I Access Childnode Of