When span is clicked, all div and body events are triggered. To prevent such occurrence and use a Simulated Event. The specific implementation is as follows. If you are interested, refer
The Code is as follows:
Click Show Hidden content
Here is the hidden content
Script
$ (Document). ready (function (){
$ ("Span"). bind ("click", function (){
$ (". Message"). show ();
});
$ (". Content"). bind ("click", function (){
$ (". Message"). show ();
});
$ ("Body"). bind ("click", function (){
$ (". Message"). show ();
});
});
Script
When span is clicked, all p and body events are triggered. To prevent this occurrence
$ ("Span"). bind ("click", function (e ){
$ (". Message"). show ();
E. stopPropagation (); // complete the event clearing action
});
Trigger
The Code is as follows:
$ (". Content"). bind ("myclick", function (event, message1, message2 ){
$ ("# Test"). append (message1 + messages2 );
});
$ ("# Btn"). trigger ("myclick", ["My events", "triggered"]);