Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Span element change event

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.

like image 640
user295541 Avatar asked Jun 01 '10 13:06

user295541


People also ask

How do you change the span of an element?

Use the textContent property to change the text of a span element, e.g. span. textContent = 'Replacement text' . The textContent property will set the text of the span to the provided string, replacing any of the existing content.

Does span have textContent?

Use the textContent property to get the text of a span element, e.g. const text = span. textContent . The textContent property will return the text content of the span and its descendants. If the element is empty, an empty string is returned.

Why would you use the span element?

The <span> HTML element is a generic inline container for phrasing content, which does not inherently represent anything. It can be used to group elements for styling purposes (using the class or id attributes), or because they share attribute values, such as lang .

What is span in inspect element?

The <span> tag is an inline container used to mark up a part of a text, or a part of a document. The <span> tag is easily styled by CSS or manipulated with JavaScript using the class or id attribute. The <span> tag is much like the <div> element, but <div> is a block-level element and <span> is an inline element.


2 Answers

From 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.

like image 175
GvS Avatar answered Sep 22 '22 21:09

GvS


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.org/en/DOM_Events for more information.

like image 35
azatoth Avatar answered Sep 23 '22 21:09

azatoth