An example of the execution order between the href jump and onclick of the html hyperlink a tag

An example of the execution order between the href jump and onclick of the html hyperlink a tag

The execution relationship between the href jump and onclick of the html hyperlink a tag
The href of the html a tag is used for jumping, but if an onclick event is added, what is the execution order?
as follows:
[code]
<a href="1.html" onclick="return confirm('Do you want to delete this node?');" ><img src="shanchu.gif"></a>

If onclick returns false, a does not jump;
If onclick returns true, a jumps

Note: Add the return keyword in onclick

This is often used to make judgments before jumping! !

<<:  Do not start CSS pseudo-class names with numbers

>>:  How to handle super large form examples with Vue+ElementUI

Recommend

Talking about Less and More in Web Design (Picture)

Less is More is a catchphrase for many designers....

Summary of javascript date tools

let Utils = { /** * Is it the year of death? * @r...

Summary of MySQL lock related knowledge

Locks in MySQL Locks are a means to resolve resou...

Detailed steps for installing and using vmware esxi6.5

Table of contents Introduction Architecture Advan...

js to realize the rotation of web page pictures

This article shares the specific code of js to re...

Professional and non-professional web design

First of all, the formation of web page style main...

javascript realizes 10-second countdown for payment

This article shares the specific code of javascri...

Detailed tutorial on installing the jenkins container in a docker environment

Recommended Docker learning materials: https://ww...

Introduction to the use and disabling of transparent huge pages in Linux

introduction As computing needs continue to grow,...

How to Install Oracle Java 14 on Ubuntu Linux

Recently, Oracle announced the public availabilit...

A brief summary of all encapsulation methods in Vue

Table of contents 1. Encapsulation API 2. Registe...

Sample code for JS album image shaking and enlarging display effect

The previous article introduced how to achieve a ...

Detailed tutorial on building Gitlab server on CentOS8.1

There is no need to say much about the difference...

CSS3 simple cutting carousel picture implementation code

Implementation ideas First, create a parent conta...

The process of using vxe-table to make editable tables in vue

There is a table in the project that needs to be ...