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