Home > Web Front-end > JS Tutorial > Use JavaScript to modify the method executed by the onclick event in the component

Use JavaScript to modify the method executed by the onclick event in the component

高洛峰
Release: 2016-11-25 14:03:57
Original
1274 people have browsed it

In the past, I often encountered a situation in projects where clicking on the same html component would execute different methods or functions. So I wrote the following method myself, which is relatively stupid, but still executable.

The core code is as follows:

1.                                                                                                                                                                                                                                                      .         * Created by: FrancisRan

6.        * Created time: 2010-07-30

7.             * Last modified time: 2010-07-30

8.                                    .com

9.            */

10.                                                             tTest" ; alert("Modify The last onclick: nn" + document.getElementById("eventTest").onclick); ​​​// Modified event

28.        function alertEvent2 () {

29.               alert("This is an event triggered after deletion"); script>

33.

34.

35.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template