I am trying to add preventDefault()
for a function as below :
HTML:
<a href="#" id="makePaid" onclick="makePaidModalView(1, evnt)">Make Paid</a>
Javascript:
function makePaidModalView(id, e) {
e.preventDefault();
alert(id);
}
But it is not alerting anything. Console says ReferenceError: e is not defined
. How do I add the preventDefault()
in this function ?