You could force the issue:
$(function()
{
$("#make_change").click(function()
{
$("#the_span").html('some content').trigger('change');
});
$("#the_span").change(function()
{
alert('change happens');
});
});
<button id="make_change">click</button>
<span id="the_span"></span>
On Thu, Dec 11, 2008 at 5:49 PM, Geuis <[email protected]> wrote:
>
> On the site I'm working on, we have some span tags with IDs. The spans
> are initially rendered on the page with no text content. When certain
> events happen, text error messages are loaded into these spans. I want
> to write an additional handler that is triggered when the text content
> of the span is changed. The onchange(jquery change) event doesn't fire
> on non-form elements. I suspect I can utilize DOM Mutation events,
> however the support for these is not universal, especially in IE. Has
> someone else worked out a solution for this? I can jank it and use a
> timer, but that is messy and causes additional load in the page.