Hi, I have a jquery function that runs on an onclick anchor, the function looks like this:
function dropDown(subid, e) {
e.preventDefault();
var sub = '#' + subid;
$('.subnav').css({'display' : 'none'});
$(sub).css({'display' : 'block'});
}
here is how i can run it:
<a href="#!" onclick="dropDown('sn_cities')" >Cities</a>
However, I get this error: e is undefined
I want to cancel the default onclick event for binding, any help would be appreciated.
source
share