top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration

Facebook Login
Site Registration

what is use for preventdefault () method in jquery ?

0 votes
131 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
Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...