I'm trying to change an image using the replace command when toggling using jquery..basically showing a downward arrrow which becomes an upward arrow after the content is revealed. This following code works except the downward arrow doesn't get replaced.
<img src="/images/arrow_down.png" id="#1" class="nav-toggle">
<div id="1" style="display:none">some content</div>
and here is the jquery code
jQuery('document').ready(function($) {
jQuery('.nav-toggle').click(function() {
var collapse_content_selector = $(this).attr('id');
var toggle_switch = $(this);
$(collapse_content_selector).toggle(function() {
if ($(this).css('display') == 'none') {
} else {
toggle_switch.attr("src").replace("down", "up");
}
});
});
});