I want to change the text of the label which is associated with the radiobutton id=\"male\". I have tried various ways to do it, but i can\'t make it work. I want to change
You can use
var r = document.getElementsByTagName("label")
to select all the label element in your page and then use
r[0].innerHTML ="new text"
to select first label and set the text to "next text" in your test() function