“html onClick Stop Propagation” Kod odpowiedzi

Onclick Stoppropagation

<span onclick="event.stopPropagation(); alert('you clicked inside the header');">something inside the header</span>
Average Anaconda

html onClick Stop Propagation

// "event" is not universally supported, so instead grab the first
// argument passed through the onclick handler and call
// "stopPropagation()" on it
<div onclick="(arguments[0] ? arguments[0].stopPropagation() : false);">...</div>
P. Tune

Odpowiedzi podobne do “html onClick Stop Propagation”

Pytania podobne do “html onClick Stop Propagation”

Więcej pokrewnych odpowiedzi na “html onClick Stop Propagation” w HTML

Przeglądaj popularne odpowiedzi na kod według języka

Przeglądaj inne języki kodu