Javascript examples for DOM:Element textContent
Change text of a child element using JavaScript
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){// w w w. j a v a 2s . c om document.querySelector('label[for="my"]').textContent = 'Black'; } </script> </head> <body> <li> <input type="radio" id="my" class="radio product-custom-option" name="options[82]"> <span class="label"> <label for="my">None</label> </span> </li> </body> </html>