开发者

MVC Edit View, JQuery change

开发者 https://www.devze.com 2023-01-05 03:02 出处:网络
I have an MVC view with the following jquery. <script type=\"text/javascript\" language=\"javascript\">

I have an MVC view with the following jquery.

<script type="text/javascript" language="javascript">
    $(document).ready(function () {
        $('#myinput).change(function () {
            alert('Changed');
   开发者_运维知识库     });
    });
</script>

When I change the text in the 'myinput' box, I want the alert 'Changed' to be displayed. This works fine... On the second change. The first time the text is changed, nothing happens.

What am I doing wrong?


try keyup instead of change


The strange behaviour appears to be a bug in jQuery 1.4.1. After upgrading to 1.4.2, the event worked as documented.

0

精彩评论

暂无评论...
验证码 换一张
取 消