This is often used with hyperlinks.
To prevent the page from refreshing, you could use void(0).
Using “#” in anchor tag: When writing the following code in the editor, the web page is refreshed after the alert message is shown.
- Maximum number of consecutive 1's in binary representation of all the array elements
- Maximum frequency of a remainder modulo 2i
- How to animate scrollTop using jQuery ?
- How to select text nodes using jQuery ?
- Why require_once() function is so bad to use in PHP ?
- HTML | DOM FocusEvent
- PHP | Imagick setCompression() Function
- PHP | Imagick getImageAlphaChannel() Function
- HTML5 | MathML <munderover> Tag
- PHP | image_type_to_extension() Function
- PHP | Imagick setFormat() Function
- PHP | Imagick getImage() Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.