control radio button from textfield value
<p>everyone..i want after i type "0203-ED" in textfield ...two character behind that text can control the radio button.. "ED" character from that text can make one radiobutton which has value="ED" are checked...</p>

<p>this is my code:</p>

<pre><code>&lt;script type="text/javascript"&gt;
      var model=$("#tags1").val();
      var version[0,0]="JD";
      var version[0,1]="87.5-107.9";
      var version[1,0]="ED";
      var version[1,1]="87.5-108.0";
      var version[2,0]="EED";
      var version[2,1]="65.0-74.0";

     // each version
      for (var i = 0; i &lt; version.length; i ++) {
          if (model.lastIndexOf(version[i,0])!=-1) {
              $("#value").replaceWith("&lt;div id='value'&gt;"+version[i,1]+"&lt;/div&gt;");
          } else {
                $("#value").replaceWith("&lt;div id='value'&gt;&lt;/div&gt;")
          }
      // end each
      }
  &lt;/script&gt;
</code></pre>

<p>what's wrong with my code??</p>
