Converting single quotes to double quotes inside a title attribute
<p>I have an image title that has a tag with double quotes in it, and I need to convert it to single quotes for use in a photo slideshow. I don't have the option of changing anything other than the attribute name, so I can't escape the quotes inside the value. </p>

<p>Here's my html:</p>

<pre><code>&lt;div  id="image-gallery"&gt;
&lt;img alt="Alt Text" src="photo.jpg" title="Title &lt;a href="#link"&gt;here&lt;/a&gt;" /&gt;
&lt;/div&gt;
</code></pre>

<p>I've tried grabbing the title and using replace to change the double quotes to single quotes, like so:</p>

<pre><code>mystr=string = $("#image-gallery img").attr('title');
mystr=mystr.replace(/\"/g,'\'');
</code></pre>

<p>The title still drops off after the first double quote though. Any ideas?</p>

<p>Thanks!</p>
