Created
February 23, 2018 21:27
-
-
Save lelandsmith/7d472e556c851049a370b9d45bf907ff to your computer and use it in GitHub Desktop.
JS Custom Trigger
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function(){ | |
$("p").on("myOwnEvent", function(event, showName){ | |
$(this).text(showName + "! What a beautiful name!").show(); | |
}); | |
$("button").click(function(){ | |
$("p").trigger("myOwnEvent", ["Anja"]); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment