0
$("div").bind("click", function() {
    $("body").append("<p>click event</p>");
}).bind("click.plugin", function() {
    $("body").append("<p>click.plugin event</p>");
})

$("button").click(function() {
    $("div").trigger("click!");  
});

In book said that ! is to match all click methods which don't include in namespace. That means click the button only execute click event!

But this trigger doesn't work.

5
  • instead of $("div").trigger("click!"); it should be $("div").trigger("click"); Commented Sep 16, 2014 at 14:21
  • If I do this, ad the same time click.plugin event will be execute! I only want to execute click event! Commented Sep 16, 2014 at 14:23
  • 5
    In which book did you find something about click!? Commented Sep 16, 2014 at 14:41
  • Not only there's no such book, you should also close your </p> tags and learn the difference between variable and String "string" Commented Sep 16, 2014 at 14:48
  • I am in china, The book has a wrong argument, Do you have any good books about Jquery to suggestion? Commented Sep 28, 2014 at 8:23

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.