I have this HTML element:
<div id='4-12-2012' class='date'>blah blah blah</div>
And I bind the click event to .date, so when it clicks, the function is called. My goal is to ultimately indicate the date (from the identifier) ββusing a slash instead of a dash:
d = $(this).attr('id').replace('/-/g', '/'); alert(d);
It may not be much simpler ... but the result that displays with a warning () still has a dash, "4-12-2012" ... which is quite obvious that I am missing here?! :-)
source share