Span Element Change Event

My question is:

Does the span element have an internal html change element? I think that I have a gap, and when the internal html of the range changes, will it generate an event that I can achieve?

I would like to use jquery to bind to this span event.

. L

+6
javascript jquery
source share
4 answers

From jQuery documentation :

A change event is dispatched to an element when its value changes. This event is restricted to <input> , <textarea> and <select> elements.

+5
source share

These events are not currently supported by browsers such as IE, but what you are looking for are DOM events. See https://developer.mozilla.org/en/DOM_Events for more details.

+2
source share

Not. As a rule, if something internal to the script changes something, it will not trigger an event.

Nothing external to the script can edit the innerHTML of the range (if it's possibly contentEditable), so there is no event.

+1
source share

Why not process it when you make changes?

 function updateHTML(el,newhtml,callback){ el.innerHTML=newhtml; if(typeof callback=='function')callback(el); } 
0
source share

All Articles