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 7962331
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:18:28+00:00 2026-06-04T05:18:28+00:00

Ive used when a select list’s option is changed as an event listener, with

  • 0

Ive used when a select list’s option is changed as an event listener, with something like this:

$('#mySelect').change(function() {
        functionToRun();
});

Is it OK to use the event listener more than once? So something like below. I know for this exact example it makes no sense, but for more complicated code with conditionals at work it would be easier for me to maintain my code if I used the event listener twice.

$('#mySelect').change(function() {
        functionToRun();
});

//other code

$('#mySelect').change(function() {
        functionToRunTwo();
});

Also, I have some code that runs on dom ready and some that runs on window load. Is it OK to use the same event listener in both instances?

  • 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-06-04T05:18:29+00:00Added an answer on June 4, 2026 at 5:18 am

    It will work as expected: both event listeners will be fired and there is certainly no problem with that. From jQuery.bind() (which is called internally by jQuery.change()):

    When an event reaches an element, all handlers bound to that event
    type for the element are fired. If there are multiple handlers
    registered, they will always execute in the order in which they were
    bound. After all handlers have executed, the event continues along the
    normal event propagation path.

    I am not sure if this answers your second question.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've seen the following used to return a list of numbers SELECT TOP (SELECT
I've used this MySQL query to get data: SELECT DISTINCT A.*, B.username FROM posts
I've seen jquery used to change a form select drop down box in to
I've used this in the past to build comma seperated lists: var list =
I've used backbone.js ' click ' event here. onClick event, I want to select
I've having trouble with nested while loops. I've created this function to list three
I'm working on an application in which a list view is used to select
This seems like it should be easy yet I must be missing something. I
I need to center text in a select list cross device and browser. This
Ive used absolute positioning and CSS3 animations so clicking a trigger div makes another

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.