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

jQuery realizes the effect of theater seat selection and reservation

jQuery realizes the effect of theater seat select...

Better-scroll realizes the effect of linking menu and content

1. Basic use <!DOCTYPE html> <html lang=...

Linux common text processing commands and vim text editor

Today, let's introduce several common text pr...

Forever+nginx deployment method example of Node site

I recently bought the cheapest Tencent cloud serv...

WeChat applet tab left and right sliding switch function implementation code

Effect picture: 1. Introduction Your own applet n...

Diving into JS inheritance

Table of contents Preface Prepare Summarize n way...

Vue3 list interface data display details

Table of contents 1. List interface display examp...

Manually implement js SMS verification code input box

Preface This article records a common SMS verific...

Mysql implements three functions for field splicing

When exporting data to operations, it is inevitab...

Summary of the application of transition components in Vue projects

​Transtion in vue is an animation transition enca...

How to modify the group to which a user belongs in Linux

Modify the group to which a user belongs in Linux...

Implementation of communication between Vue and Flask

Install axios and implement communication Here we...

About the pitfalls of implementing specified encoding in MySQL

Written in front Environment: MySQL 5.7+, MySQL d...

Detailed explanation of the problem of CSS class names

The following CSS class names starting with a num...