I want to use the function blow to prevent the default action like "a href", but it just cant work in firefox.
function alertPopup(html) {
event.preventDefault();
// ...
}
and then I added the variable "event" into this function, as blow, but also failed; the firefox console displayed the error "ReferenceError: event is not defined".
function alertPopup(html) {
function stepstop(event){
console.log("tttttt");
event.stopPropagation();
};
stepstop(event);
// ...
}
<a href="#" onclick="alertPopup("hello");">XXXXX</a>
So how can I prevent default action in this function? Without using "return false"... Thank you!