My question is:
Does have a span element the inner html change event? I think about I have a span and when the span inner html is changing it will throw an event that I can reach?
I would like to use Jquery to bind to this event of span.
l.
My question is:
Does have a span element the inner html change event? I think about I have a span and when the span inner html is changing it will throw an event that I can reach?
I would like to use Jquery to bind to this event of span.
l.
Share Improve this question asked Jun 1, 2010 at 13:01 user295541user295541 1,0154 gold badges16 silver badges26 bronze badges4 Answers
Reset to default 6From the jQuery documentation:
The change event is sent to an element when its value changes. This event is limited to
<input>
elements,<textarea>
boxes and<select>
elements.
At the moment, such events are not supported by browsers like IE, but what you are looking for is DOM events. See https://developer.mozilla/en/DOM_Events for more information.
No. As a rule of thumb, if something internal to a script changes something, it will not trigger an event.
Nothing external to a script can edit the innerHTML of a span (unless, perhaps, it is contentEditable) so there is no event.
Why not handle it when you make the change?
function updateHTML(el,newhtml,callback){
el.innerHTML=newhtml;
if(typeof callback=='function')callback(el);
}