Why doesn't this simple javascript replace change the dash to slash?
<p>I have this HTML element:</p>

<pre><code>&lt;div id='4-12-2012' class='date'&gt;blah blah blah&lt;/div&gt;
</code></pre>

<p>And I'm binding a click event to .date, so when it's clicked, a function is called. My goal is to end up with the date (from the ID) with slashes instead of dashes:</p>

<pre><code>d = $(this).attr('id').replace('/-/g', '/');
alert(d);
</code></pre>

<p>This can't be much more straightforward... but the result that is displayed with the alert() still has dashes, "4-12-2012"... what totally obvious thing am I missing here?! :-)</p>
