ASP标签文本更改事件在jQuery中 [英] asp label text changed event in Jquery

查看:45
本文介绍了ASP标签文本更改事件在jQuery中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当asp标签的值更改时,如何触发jquery方法? 我已经尝试过了,但是没有用.

How to trigger a jquerymethod when the value of an asp label changes? I have tried this one but it's not working.

 $("#lbladdsupplier").change(function () {
        alert('Changed');
    });

推荐答案

仅当更改表单元素值时才会触发change事件.

The change event is fired only when an form elements value is changed.

在这种情况下,我建议在标签更新为文本时触发自定义事件.

In this case I would suggest to trigger a custom event when the label is text updated.

例如:

$("#lbladdsupplier").html('new-label').trigger('labelchanged')

$("#lbladdsupplier").on('labelchanged', function(){
    alert.log('changed')
})

这篇关于ASP标签文本更改事件在jQuery中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆