Why will this refuse to work?
HTML stuff
filter
is the wrong method to use here. you should either use find
to look for elements in a selection:
$('div#nav-bar').find('a')...
or simply combine that into one selector:
$('div#nav-bar a')...
after you've fixed that, your preventDefault
will actually get applied and work, theres nothing wrong with that piece of code directly.