JQuery how to stop event propagation -
i'm looking stop event propagating every time click "done", alert shows once.
here code:
$('body').on('click', '#product', function () { var x = "hi"; $('#done').click(function () { alert(x); }); });
and fiddle: http://jsfiddle.net/s4sz29ew/1/
$('body').on('click', '#product', function () { var x = "hi"; $('#done').click(function (e) { alert(x); e.stoppropagation(); }); });
Comments
Post a Comment