Changing the subdomain on a bunch of url inside textareas with jQuery
<p>I have a bunch of textarea's on a page with copy and paste codes with urls inside them. </p>

<p>for exmaple:</p>

<pre><code>&lt;textarea&gt;&lt;a href="http://anything.domain.com/x/5"&gt;something&lt;/a&gt;&lt;/textarea&gt;
&lt;textarea&gt;&lt;a href="http://anything.domain.com/x/3"&gt;something&lt;/a&gt;&lt;/textarea&gt;
</code></pre>

<p>I also have a dropdown, with a bunch of subdomain options with the intent of changing the subdomain inside all the textareas on the page.</p>

<p>e.g</p>

<pre><code>&lt;select class="changeLinks"&gt;
    &lt;option value="www"&gt;www.domain.com&lt;/option&gt;
    &lt;option value="somethingelse"&gt;somethingelse.domain.com&lt;/option&gt;
&lt;/select&gt;
</code></pre>

<p>How to go through these textareas and just update the text of the subdomain? </p>

<pre><code>$('.changeLinks').change(function(){

    var subdomain = $(this).val();

 // *blank* some sort of find and replace function which replaces whatever is after the http:// and before the first decimal with the var subdomain


});
</code></pre>
