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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:32:30+00:00 2026-05-27T06:32:30+00:00

TL;DR How can I watch for changes in markup in <select> and, more importantly,

  • 0

TL;DR

How can I watch for changes in markup in <select> and, more importantly, <option> tags?

I don’t want to listen for the .change() event (onChange), but I do want to listen for any changes in attributes (disabled="disabled"), values (value="foo") or text.

The long version

I’m writing a simple <select> replacement plugin for jQuery. As one of the features, I’d like it to dynamically update with the select box. The one feature I’m stuck with is how to watch for events such as another piece of JS changing one of the <select>‘s <option>s by, for example, changing it’s text, value or disabled state.

I’ve found a question here that provides a solution, however it just sets up a setTimeout() to poll the element.

Is there a clean (by which I mean "not using setTimeout()) way of watching for modifications of elements, specifically the <option>s inside a dropdown select control? The three main things I want to watch for are:

  • When the text of the option is changed.
  • When it is disabled or enabled.
  • When it’s value is changed.

All of these triggered by a piece of JS not related to the plugin I’m writing.

  • 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-27T06:32:31+00:00Added an answer on May 27, 2026 at 6:32 am

    Other JS snippets won’t necessarily fire a dom event, so event listeners aren’t going to help you much. In fact, for your examples… the only one that will ever fire a dom event is if the value is changed. You could write some fancy selectors for jquery’s on() method to check enabled/disabled, though.

    In short, the setTimeout (or rather setInterval) may be your best bet.

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

Sidebar

Related Questions

I'm looking for a tool that can watch database(mysql and oracle) for changes. When
I want to watch a folder tree on a network server for changes. The
I want to watch a system setting and get notified when its value changes.
I'm using the following code to watch for changes to a given SELECT element.
Like in fiddler you can watch the logs between client and server. Like fiddler;
How can I watch the messages being sent back and for on urllib shttp
My question is, that how can I get the node in witch I want
In Windows, I can use the FindNextChangeNotification API to watch a file or folder
I want to write an application that gets events on every file change on
Is there any watch window to see variable value in XCode during debugging? Can

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.