Skip to content
Justice Tech School

trigger and custom events

trigger fires an event in code. You can define your own names.

Example
$("#a").on("saved", function (e, id) {
  console.log("saved", id);
});
$("#a").trigger("saved", [42]);

Exercise

Fire it.

$("a").("saved")

Quiz Test

Can events have custom names?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.