The difference between html empty link href="#" and href="javascript:void(0)"

The difference between html empty link href="#" and href="javascript:void(0)"
# contains a location information. The default anchor is #top, which is the top of the web page. JavaScript:void(0) only indicates a dead link. This is why sometimes when a page is very long, the browse link is clearly #, but it jumps to the top of the page, while JavaScript:void(0) is not the case. Therefore, it is best to use void(0) when calling scripts.
You can test this using the following example:
Code

Tip: You can modify some of the code before running

<<:  Solution for Nginx installation without generating sbin directory

>>:  New ideas for time formatting in JavaScript toLocaleString()

Recommend

A detailed tutorial on using Docker to build a complete development environment

Introduction to DNMP DNMP (Docker + Nginx + MySQL...

Is a design that complies with design specifications a good design?

In the past few years of my career, I have writte...

How to install Composer in Linux

1. Download the installation script - composer-se...

MySQL Tutorial: Subquery Example Detailed Explanation

Table of contents 1. What is a subquery? 2. Where...

Understand the initial use of redux in react in one article

Redux is a data state management plug-in. When us...

Solution to the impact of empty paths on page performance

A few days ago, I saw a post shared by Yu Bo on G...

How to restore single table data using MySQL full database backup data

Preface When backing up the database, a full data...

Introduction to keyword design methods in web design

Many times, we ignore the setting of the web page ...

Detailed explanation of the process of installing MySQL on Ubuntu 18.04.4

Let's take a look at the process of installin...

Full analysis of Vue diff algorithm

Table of contents Preface Vue update view patch s...

Detailed process of using Vscode combined with docker for development

Preface Using Docker and VS Code can optimize the...

Detailed explanation of this pointing in JS arrow function

Arrow function is a new feature in ES6. It does n...

How to use jconsole to monitor remote Tomcat services

What is JConsole JConsole was introduced in Java ...