Posted On: May 13, 2020
The event.preventDefault() method is used to stop all the default actions and event bubbling of an element from starting.
Syntax
event.preventDefault()
<script> $(document).ready(function(){ $("a").click(function(event){ event.preventDefault(); }); }); </script>
Here, the preventDefault() method prevents the link from opening the URL.
Never Miss an Articles from us.
jQuery is a lightweight JavaScript library which gives a quick and simple method for HTML DOM traversing and manipulati..
There are many advantages of JQuery. Some of them are :It is more like a JavaScript enhancement so there is no overhea..
There are 3 types of selectors in JqueryCSS Selector XPath Selector Custom Selector..