top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

what is use for preventdefault () method in jquery ?

0 votes
478 views

Please help any one with some basic examples.Am new to j query.

posted Aug 6, 2014 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

The event.preventDefault() method stops the default action of an element from happening.

For example:

Prevent a submit button from submitting a form
Prevent a link from following the URL

//Prevent a link from opening the URL:

    $("a").click(function(event)
     {
                event.preventDefault();
    });

Syntax

event.preventDefault()
answer Aug 7, 2014 by Amit Kumar Pandey
...