current position:Home>Two submit buttons call the judgment of the same onclick event
Two submit buttons call the judgment of the same onclick event
2022-02-04 17:20:23 【CSDN Q & A】
Now I form There are two of them submit, Examples are as follows :
1<button type="submit" id="a2" name="_ActionID value="a2" onclick=" function ()">2
Two submit Called onclick The method is the same , Function, please js How to judge which one I clicked in the submit Well ? Function cannot take any arguments
Take the answer :
Function can add parameters , take this( Currently clicked button object ) Pass to function
function function (el){alert(el.name)}<button type="submit" id="a2" name="_ActionID value="a2" onclick=" function (this)">
Help, please Adopt 【 This answer is in the upper right corner 】, thank you ~~ If you have other questions, you can continue to communicate ~
Other answers 2:
hold id Value as js The parameters of the function are passed into the function .
Other answers 3:
The answer code of your question is as follows :( If help , Hope to adopt ! thank you ! Click on the... At the top right of my answer 【 Adopt 】 Button )
<script>function function (){ var e = arguments.callee.caller.arguments[0] || window.event; alert(e.srcElement.value);}</script><button type="submit" id="a1" name="_ActionID" value="a1" onclick=" function ()">A1</button><button type="submit" id="a2" name="_ActionID" value="a2" onclick=" function ()">A2</button>
copyright notice
author[CSDN Q & A],Please bring the original link to reprint, thank you.
https://en.cdmana.com/2022/02/202202041720216191.html
The sidebar is recommended
- What is the description of the processing mode of the target existing table in the two-way synchronization between RDS and MySQL?
- What are the characteristics of maxcompute data migration and real-time data?
- After importing maxcompute data into elasticsearch, how many steps is the data monitoring divided into?
- Whether to filter DDL configuration in two-way synchronization between RDS and MySQL? What is the description?
- What's the use of a data umbrella?
- What is the description of conflict repair policy configuration in two-way synchronization between RDS and MySQL?
- What are the advantages of maxcompute data migration and real-time data?
- Can large tables and small tables be interchanged in mapjoin?
- What is the description of synchronization object configuration in two-way synchronization between RDS and MySQL?
- When an application deployed on SAE is running, what does a pod that is not ready mean?
guess what you like
-
What is the description of the mapping name change configuration in the two-way synchronization between RDS and MySQL?
-
What should enterprises do to effectively protect data?
-
What are the instructions for filtering the data to be synchronized in the two-way synchronization between RDS and MySQL?
-
What is the description of the SQL operation configuration in the two-way synchronization between RDS and MySQL?
-
What are the responsibilities of Devops engineers?
-
How many modules is maxcompute's data cloud task development divided into?
-
What are the instructions for setting alarm configuration in two-way synchronization between RDS and MySQL?
-
What are the concerns of Devops?
-
What are the features of maxcompute's data cloud task development data source configuration module?
-
What is the description of the target database object name case policy configuration in the two-way synchronization between RDS and MySQL?
Random recommended
- How does the nailing applet realize the function of tab
- At present, does SAE support automatic volume expansion and shrinkage, and does SAE have an API for volume expansion and shrinkage?
- In the two-way synchronization between RDS and MYSQL, what is the description of the retry time configuration after the source database and target database cannot be connected?
- What are the features of maxcompute's data cloud task development script mode task development module?
- What are the steps to develop the operation and maintenance experience of serverless?
- What are the characteristics of the task development module of maxcompute's data cloud task development Wizard mode?
- What are the characteristics of maxcompute's data cloud task development task scheduling attribute configuration module?
- What is the role of serverless application engine (SAE)?
- What source databases are supported by RDS MySQL synchronization to polardb MySQL Cluster?
- What is project protection?
- What are the prerequisites for synchronizing RDS Mysql to polardb MySQL Cluster?
- Use of spring security in distributed architecture
- Java process control
- Introduction to the mechanical arm of logistics trolley
- On the operation of C language
- How does Vue introduce this keyboard component
- How to run this GitHub app with vscode Java this file?
- Why does this always happen?
- Write a java program to define the book class
- Configuration method of using Linux firewall to let intranet users share Internet access
- On Linux file output, how to display files one paragraph at a time
- Enter how an operator is defined and called
- Why is running press enter just a line feed for an answer
- On the type of char in the sixth edition of C Primer Plus 3.4
- C language OJ questions, please inform
- Memory problem: react when switching to another interface, IMG tag pictures and style data on the original interface are not cleared, resulting in memory expansion
- How did this thing come out in idea!
- How to do without matlab for loop?
- Why is this for loop the same as others, but mine is like this
- Zero temperature span, zero temperature coefficient, full-scale temperature span, full-scale temperature span, full-scale temperature coefficient what do these mean
- Matching Douban movie top250 movie information using regular expressions
- It's always displayed in the formal parameter table. What's the mismatch? I'm dizzy, vs2019
- driver. execute_ Function and parameter meaning of script
- There is a problem building the image of dockerfile
- English to Chinese ecognition
- There is an error in the detection class file. How can I modify it
- C language data structure stack problem
- What if an invalid index of a scalar variable occurs? Invalid index to scalar variable It seems that this is all done with the code, with some modifications, but it's just the import of the data set
- Application of portal technology
- A company has applied for the 192.168.1.0/24 network segment. Please use this network segment to allocate the IP addresses of five departments to?