title: Javascript replace function "is not a function"
body: <p>I have an issue with the following code. I want to replace a string by another one, and generate an img code. However, I got an error message: <code>str.replace is not a function</code>. Any idea why?</p>
  
  <pre><code>    &lt;input type="text" id="text"&gt;
      &lt;input type="button" value="See Code" onclick="myFunction();"&gt;
      &lt;input type="text" id="code" name="code"&gt;
  
  &lt;script&gt;
      function myFunction() {
          var str = parseInt(document.getElementById("text").value);
          var res = str.replace("ftpadress", "htmladress");
          var code = str.concat("&lt;img src='",res,"' width='100%'&gt;");
          document.getElementById("code").value = code;
          }
  &lt;/script&gt;
  </code></pre>