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

  • Home
  • SEARCH
  • 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 3942226
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T00:38:14+00:00 2026-05-20T00:38:14+00:00

In javascript, possibly using jQuery, how can I detect if the html content of

  • 0

In javascript, possibly using jQuery, how can I detect if the html content of a given element has changed?

I’d like to be able to do somthing like:

$('#myDiv').change(function(){
  // do some stuff
});

I am basically trying to detect if given elements are being added to the div or if the inner html of given elements (such as labels) has changed and then hide or show the div depending on the content.

Any alternative idea about how to achieve smt like this is also appreciated.

I am hoping I won’t have to revert to some obscure plugin to do this!

NOTE: this needs to work at least in IE8!

  • 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-20T00:38:14+00:00Added an answer on May 20, 2026 at 12:38 am

    You can use the DOM Level 3 event DOMNodeInserted. Example:

    $('#myDiv').bind('DOMNodeInserted', function(e) {
        console.log('element: ', e.target, ' was inserted');
    });
    

    Demo: http://www.jsfiddle.net/vsgdZ/1/

    The event will fire whenever a new node was appended to the element on which you bind the handler.

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

Sidebar

Related Questions

I am using the jQuery Tools library Tabs. You can find them here: http://flowplayer.org/tools/tabs/index.html
Here's a dead-simple webpage that leaks memory in IE8 using jQuery (I detect memory
I'm building an iOS centric web page using HTML5, CSS3 and Javascript with jQuery
I'm looking to implement a chat room using PHP/Javascript (Jquery) with both group chat
Is it possible to launch a new window in JavaScript using the window.Open function,
Is it possible to intercept every request made from a page using javascript? i.e.
Is it possible to close parent window in Firefox 2.0 using JavaScript. I have
I have been hearing a lot about Ruby and possibly even Javascript being true
I'm interested in seeing a good diff algorithm, possibly in Javascript, for rendering a
I'd like a short smallest possible javascript routine that when a mousedown occurs on

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.