<html>
<head></head>
<body>
<span class="mtb-price">
<label Class="mtb-ofr"><b class="lb1"></b>AAAAA</label></span>
<script>
var sku = document.getElementsByClassName("mtb-ofr").childNodes[1].nodeValue;
alert(sku);
</script>
</body>
</html>
How do i access childNode of having class name ‘mtb-ofr’ using document.getElementsByClassName() ?
and what should be the alternative of document.getElementsByClassName() to obtain the same result ??
to change the label’s text: