jQuery: Listen to changes within a DIV and act accordingly

Posted by Chris on Stack Overflow See other posts from Stack Overflow or by Chris
Published on 2010-04-26T08:50:35Z Indexed on 2010/04/26 8:53 UTC
Read the original article Hit count: 184

Filed under:

I have a function that grabs an XML document and transforms it according to an XSL document. It then places the result into a div with the id laneconfigdisplay. What I want to do is, separate to the transformation logic, setup a jQuery change event for that div so I can tell when it has changed, and run some jQuery code.

I have tried the following, but it does not work!

$(document).ready(function()
{
    $('#laneconfigdisplay').change(function() {
        alert('woo');
    });
    //Do XML / XSL transformation here
});

<!-- HTML code here -->
<div id="laneconfigdisplay"></div>

What am I doing wrong?

© Stack Overflow or respective owner

Related posts about jQuery