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.
- Serial I/O Lines in 8085 Microprocessor
- Object Oriented Testing in Software Testing
- How to create To-Do List using jQuery?
- Ways to capture the backspace and delete on the onkeydown event
- PHP | Gmagick setimageprofile() Function
- Node.js | os.freemem() Method
- PHP | Gmagick trimimage() function
- Node.js | os.EOL
- PHP | GmagickDraw ellipse() function
- Node.js | dnsPromises.resolve() Method
- PHP | GmagickPixel getcolorcount() Function
- Node.js | util.types.isSymbolObject() Method
- Node.js | os.endianness() Method
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.