Create url on the fly
<p>I have some pages with a p tag</p>

<pre><code>Page 1:     &lt;p id="cat-one"&gt;&lt;/p&gt;

Page 2:    &lt;p id="cat-two"&gt;&lt;/p&gt;

Page 3:   &lt;p id="cat-one"&gt;&lt;/p&gt;
</code></pre>

<p>and so on.</p>

<p>I have to first examine the para in the page and create a url dynamically and insert it into the para, depending on which category it belongs to.</p>

<pre><code>Eg: cat-one
url  &lt;a href="http://sdsdsad.com" target="_blank" /&gt;

cat-two
url  &lt;a href="http://vbccvbcv.com" target="_blank" /&gt;

cat-three
url  &lt;a href="http://ohgdssas.com" target="_blank" /&gt;
</code></pre>

<p>and so on.</p>

<p>This is what I have done</p>

<pre><code> var newLink = $('&lt;a href="sdfdsfsdf.html" target="_blank"'&gt;SomeText&lt;/a&gt;');
    $("#cat-one").append(newLink);
</code></pre>

<p>however no idea who to check each para in an article and dynamically generate url;s</p>
