Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6209969
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:04:44+00:00 2026-05-24T06:04:44+00:00

There are two onchange triggers: one on the INPUT and one from the FORM

  • 0

There are two onchange triggers: one on the INPUT and one from the FORM containing the INPUT.

document.getElementByTagName('form')[0].addEventListener('change',funcForm);
document.getElementByTagName('input')[0].addEventListener('change',funcInput);
  1. does funcForm or funcInput fire first?

  2. is this behavior defined and consistent?

  3. if e.stopPropagation() is issued on the first firing trigger, does the second fire?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T06:04:45+00:00Added an answer on May 24, 2026 at 6:04 am

    The input’s handlers should be triggered first and then the event should bubble up the DOM hierarchy if it bubbles. From the DOM Events specification:

    The event is dispatched to its target EventTarget and any event listeners found there are triggered. Bubbling events will then trigger any additional event listeners found by following the EventTarget’s parent chain upward
    […]
    Any event handler may choose to prevent further event propagation by calling the stopPropagation method of the Event interface. If any EventListener calls this method, all additional EventListeners on the current EventTarget will be triggered but bubbling will cease at that level. Only one call to stopPropagation is required to prevent further bubbling.

    The second paragraph applies to stopPropagation and says that if the listener on the input calls e.stopPropagation(), then the event should not get up to the <form>. However, any remaining listeners on the <input> will see the change event, stopPropagation just keeps the event from bubbling up the tree any further than the level at which stopPropagation is called.

    Furthermore, the change event does bubble:

    change
    The change event occurs when a control loses the input focus and its value has been modified since gaining focus. This event is valid for INPUT, SELECT, and TEXTAREA. element.

    • Bubbles: Yes
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to have two functions checking each form input, one for onchange() and
I have a form that contains two input textboxes, one called serial and the
There are two databases in SQL Server 2005: One called A and another one
There are two pictureboxes with two different images. If I click on one picture
Hello I have two dependants select box, the second one is popularited after onchange
I'm creating a web form, where in there are around 12-15 Input Fields... You
I'm using CakePHP for a small web app and on one form page there's
I have an input field with onChange event which triggers an AJAX call which
On a form I have, there are two checkboxes, say Master and Slave. Whenever
There are two weird operators in C#: the true operator the false operator If

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.