Right now str.replace is only working for 1st row , i want str.replace to work on selected radio button row.
<tr>
<td><input onclick="myFunction()" type="radio" name="test" value="1"></td>
<td id = "demo">System Architect1 #BLANK1# test #BLANK2#</td>
<td>Edinburgh</td>
</tr>
<tr>
<td><input onclick="myFunction()" type="radio" name="test" value="2"></td>
<td id = "demo">System Architect2 #BLANK1# test #BLANK2#</td>
<td>Edinburgh</td>
</tr>
<tr>
<td><input onclick="myFunction()" type="radio" name="test" value="3"></td>
<td id = "demo">System Architect3 #BLANK1# test #BLANK2#</td>
<td>Edinburgh</td>
</tr>
<script>
function myFunction() {
var str = document.getElementById("demo").innerHTML;
var res = str.replace("#BLANK1#", "<input type='text' name='BLANK1' maxlength='50' />")
.replace("#BLANK2#", "<input type='text' name='BLANK2' maxlength='50' />")
.replace("#BLANK3#", "<input type='text' name='BLANK3' maxlength='50' />")
.replace("#BLANK4#", "<input type='text' name='BLANK4' maxlength='50' />");
document.getElementById("demo").innerHTML = res;
}
</script>