Nov 10, 2018

How to prevent web browser’s default response to an event

If you want to prevent the web browser’s normal response to an event, use preventDefault(). By default, when you click on the hyperlink, the normal response of the event is to transfer you to the url represented in the hyperlinks href attribute.

    <a href="" id="i88"></a>

Here clicking on the hyperlink transfers you to If you want to prevent this default behavior, use preventDefault():

$("a").click(function (e) {
    // do something else