跨文本/ html触发器已更改 [英] Trigger for span text/html on changed
问题描述
在 span
标记文本/ html已被更改时触发的jQuery或JavaScript中是否有任何事件?
代码:
< span class =user-location> < /跨度>
$ b $('。user-location')。change(function(){
//不工作
});
提前致谢! 检查以下链接 https://jsbin.com/volilewiwi/edit?html,js,output Is there any event in jQuery or JavaScript that triggered when Code: Thanks in advance! you can use check out the followinf link https://jsbin.com/volilewiwi/edit?html,js,output 这篇关于跨文本/ html触发器已更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! DOMSubtreeModified
来追踪span元素的变化,即(如果span元素的文本动态变化)。 $ b $('。user-location')。on('DOMSubtreeModified',function(){
alert('changed')
)
span
tag text/html has been changed ?<span class="user-location"> </span>
$('.user-location').change(function () {
//Not working
});
DOMSubtreeModified
to track changes on your span element i.e(if text of your span element changes dynamically ).$('.user-location').on('DOMSubtreeModified',function(){
alert('changed')
})