for example, here's the code:

star = document.getElementById("imageStar"); star.addEventListener('touchend', function (event) { event.stopImmediatePropagation(); }, false); star.addEventListener("touchend", function (event) { alert("это не должно появиться!");} ); 

It works . First the first handler is executed.

 event.stopImmediatePropagation(); 

and the second handler does not work, but if in the second handler you replace touchend with touchstart or click then event.stopImmediatePropagation (); will stop working and all handlers will be executed

  • Suddenly, who does not know developer.mozilla.org/ru There about all the html, javascript and a whole lot more. Even with working examples that are immediately tested. - Sergey
  • If touchend replaced with touchstart these will be handlers for different events, and stopImmediatePropagation stops processing only the current event. Moreover, it is obvious that touchstart will happen earlier, so the example is not about that at all. - Alexey Ten

0