jQuery append value from textarea to input
<p>While entering input in a Textarea I want the same text to append to an input, i.e. the input has a value of "<a href="http://www">http://www</a>." and whatever I enter in the textarea I want to be appended to input's value.</p>

<p>Now it always adds the change to the change, e.g.:</p>

<p>(entering google.com in the textarea)
it adds:
g
go
goo
goog
etc.
which results in:
<a href="http://www.ggogoogoog" rel="nofollow">http://www.ggogoogoog</a>... etc.</p>

<p>what am I doing wrong?</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>var titleLink = "";
var url = $('#text2');
 
function inputLink(){  
  titleLink = $('#text1').val();
  console.log("changed: " + titleLink);
  var http = url.val(); 
  url.val(http + titleLink);
 };</code></pre>
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
&lt;textarea name="text1" id="text1" cols="30" rows="10" oninput="inputLink()"&gt;&lt;/textarea&gt; &lt;br&gt;
&lt;input id="text2" type="text" value="http://www."&gt;</code></pre>
</div>
</div>
</p>