
- Javascript Basics Tutorial
- Javascript - Home
- Javascript - Overview
- Javascript - Syntax
- Javascript - Enabling
- Javascript - Placement
- Javascript - Variables
- Javascript - Operators
- Javascript - If...Else
- Javascript - Switch Case
- Javascript - While Loop
- Javascript - For Loop
- Javascript - For...in
- Javascript - Loop Control
- Javascript - Functions
- Javascript - Events
- Javascript - Cookies
- Javascript - Page Redirect
- Javascript - Dialog Boxes
- Javascript - Void Keyword
- Javascript - Page Printing
- JavaScript Objects
- Javascript - Objects
- Javascript - Number
- Javascript - Boolean
- Javascript - Strings
- Javascript - Arrays
- Javascript - Date
- Javascript - Math
- Javascript - RegExp
- Javascript - HTML DOM
- JavaScript Advanced
- Javascript - Error Handling
- Javascript - Validations
- Javascript - Animation
- Javascript - Multimedia
- Javascript - Debugging
- Javascript - Image Map
- Javascript - Browsers
- JavaScript Useful Resources
- Javascript - Questions And Answers
- Javascript - Quick Guide
- Javascript - Functions
- Javascript - Resources
How to make an anchor tag refer to nothing?
To make an anchor tag refer to nothing, use “javascript: void(0)”. The following link does nothing because the expression "0" has no effect in JavaScript. Here the expression "0" is evaluated, but it is not loaded back into the current document.
Example
<html> <head> <script> <!-- //--> </script> </head> <body> <p>Click the following, This won't react at all...</p> <a href="javascript:void(0)">Click me!</a> </body> </html>
- Related Articles
- How to add and remove a class to an anchor tag with jQuery?
- How to add a title in anchor tag using jQuery?
- How to find anchor tag in div and add class using jQuery?
- How to add a class on click of anchor tag using jQuery?
- Is wrapping a div inside an anchor tag valid code?
- How to create an anchor pane using JavaFX?
- What does an InfoStore refer to in SAP BO?
- How to Anchor an Element to the Correct Position On A Responsive Image?
- How to set a Variable to equal nothing in SASS?
- How to use Meta Tag to redirect an HTML page?
- How to use an HTML tag inside HTML table?
- How to refer to a element that contains pre-defined options for an element in HTML?
- How to add readonly attribute to an input tag in JavaScript?
- How do we include an anchor in HTML?
- How to remove an attribute from each tag using jQuery?

Advertisements