Last updated 2 years ago
Was this helpful?
⟩ ⟩ ⟩ ⟩ example ⟩ button in paragraph
if the button is right-clicked, the event will stop propagation to its enclosing paragraph.
replit >
const {log} = console // ⭐️ import import { $ } from './js/ext/Node_ext.js'; // Node extension // -------------------------------------------------------------------- // ⭐️ event handlers // <button> $('button').onmousedown = function(e) { log(`🐭`); // ⭐️ if right-clicked, stop event propagation. if (e.button === 2) e.stopPropagation(); }; // <p> $('p').onmousedown = function() { log(`🅿️`); };
Eloquent JS ⟩ ⟩
⟩