Question

1.
2.
3.
4.
Answer (Detailed Solution Below)

Option 4 : the button's listener runs first, then the event bubbles outward to the div's listener. / बटन का श्रोता पहले चलता है, फिर इवेंट बाहर की ओर बबल होकर div के श्रोता तक पहुँचता है।

Advertisement

Detailed Solution

सही उत्तर the button's listener runs first, then the event bubbles outward to the div's listener. / बटन का श्रोता पहले चलता है, फिर इवेंट बाहर की ओर बबल होकर div के श्रोता तक पहुँचता है। है।

Key Points
Helpful?
PrepSnapprepsnap.in • Part -A

Question:

A button sits inside a div. Both have click listeners registered for the bubble phase. When the button is clicked, / एक बटन div के भीतर है। दोनों में बबल चरण हेतु क्लिक श्रोता पंजीकृत हैं। बटन क्लिक करने पर,

1.
the div's listener runs first, then the button's. / div का श्रोता पहले चलता है, फिर बटन का।
2.
only the button's listener runs. / केवल बटन का श्रोता चलता है।
3.
neither runs unless capture is enabled. / कैप्चर सक्षम किए बिना कोई नहीं चलता।
4.
the button's listener runs first, then the event bubbles outward to the div's listener. / बटन का श्रोता पहले चलता है, फिर इवेंट बाहर की ओर बबल होकर div के श्रोता तक पहुँचता है।

Correct Answer: the button's listener runs first, then the event bubbles outward to the div's listener. / बटन का श्रोता पहले चलता है, फिर इवेंट बाहर की ओर बबल होकर div के श्रोता तक पहुँचता है।

In the bubble phase the event travels from the target outward through ancestors, so the innermost listener fires first. / बबल चरण में इवेंट लक्ष्य से बाहर की ओर पूर्वजों से होकर जाता है, अतः सबसे भीतरी श्रोता पहले चलता है।

Downloaded from PrepSnap (prepsnap.in)