Hello, i'm working on a little script and am stuck. What I'm trying to do is select the text that appears after a checkbox and replace it with text that contains html. The problem with the code below is it replaces the text as expected but displays the html literally in the browser. I've tried replacing nodeValue with innerHTML and then nothing happens.


The javascript looks like this:
Code JavaScript:
window.onload = function () {
   var listA = fm_get_form_item('custom_list-4f444fdada9c1'); //Wordpress plugin hook
   for(var x=0;x<listA.length;x++){
      listA[x].nextSibling.nodeValue = section_details[x];
   }
}


listA looks like this (chrome debugger output):
Code:
[
<input type=​"radio" name=​"custom_list-4f444fdada9c1" id=​"custom_list-4f444fdada9c1-0" value=​"0">​
, 
<input type=​"radio" name=​"custom_list-4f444fdada9c1" id=​"custom_list-4f444fdada9c1-1" value=​"1">​
, 
<input type=​"radio" name=​"custom_list-4f444fdada9c1" id=​"custom_list-4f444fdada9c1-2" value=​"2">​
, 
<input type=​"radio" name=​"custom_list-4f444fdada9c1" id=​"custom_list-4f444fdada9c1-3" value=​"3">​
]

section_details has 4 items each has unique text that includes html.


The html looks like this:
Code HTML4Strict:
<input type="radio" name="custom_list-4f444fdada9c1" id="custom_list-4f444fdada9c1-0" value="0">  Regular text 4
<input type="hidden" id="custom_list-4f444fdada9c1-0-value" value="Regular text 4"><br>
<input type="radio" name="custom_list-4f444fdada9c1" id="custom_list-4f444fdada9c1-1" value="1">  Regular text 3
<input type="hidden" id="custom_list-4f444fdada9c1-1-value" value="Regular text 3"><br>
<input type="radio" name="custom_list-4f444fdada9c1" id="custom_list-4f444fdada9c1-2" value="2">  Regular text 2
<input type="hidden" id="custom_list-4f444fdada9c1-2-value" value="Regular text 2"><br>
<input type="radio" name="custom_list-4f444fdada9c1" id="custom_list-4f444fdada9c1-3" value="3">  Regular text 1
<input type="hidden" id="custom_list-4f444fdada9c1-3-value" value="Regular text 1">
<input type="hidden" id="custom_list-4f444fdada9c1-list-style… value="radio">
<input type="hidden" id="custom_list-4f444fdada9c1-count" value="4">


Thanks for your help.