This article is a mirror article of machine translation, please click here to jump to the original article.

View: 7745|Reply: 1

[Angular] Angular prevents the triggering of the parent click event

[Copy link]
Posted on 4/6/2022 5:12:00 PM | | |
Requirements: The parent div is bound to the A event, the child element button button in the div is bound to the B time, when the button button is clicked, the B event will be triggered first, and then the A event will be triggered, I just want to trigger the B event, I don't want to trigger the A event of the parent class.

If yesPure HTML and JSThe click event code for clicking on a child element event without triggering the parent element is as follows:

The Angular project code is as follows:

Reference articles:The hyperlink login is visible.





Previous:ASP.NET Core (fourteen) is based on the SkiaSharp image captcha
Next:PoorMans Free SQL Server Database T-SQL Formatter
Posted on 4/7/2022 2:43:20 PM |
Learn below...
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com