find all youtube links with js (jquery)
<p>Say there is a div that has content and a youtube link.  I want to grab that youtube link and embed it.</p>

<pre><code>&lt;div id="content"&gt;&lt;p&gt;Here is a cool video.  Check it out: http://www.youtube.com/watch?v=oHg5SJYRHA0&lt;/p&gt;&lt;/div&gt;
</code></pre>

<p>I want to grab the link and replace it with the embed code with js (jquery).</p>

<p>Update 1:</p>

<p>This is my js so far:</p>

<pre><code>    $("#content").each(function(){
 var allContent = $(this).html();
 //need regex to find all links with youtube in it, ovbiously it can't == youtube.com, but basically the link has to have youtube.com in it.
 if ($("a",allContent).attr("href") == "youtube.com" ) {
  // grab youtube video id
  /* replace link with &lt;div id="yt-video"&gt;
  &lt;object width="560" height="340"&gt;&lt;param name="movie" value="http://www.youtube.com/v/429l13dS6kQ&amp;hl=en&amp;fs=1&amp;"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/429l13dS6kQ&amp;hl=en&amp;fs=1&amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"&gt;&lt;/embed&gt;&lt;/object&gt;
  &lt;/div&gt;
  */
 }
});
</code></pre>
