views:

23

answers:

2

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?

A: 

try keyup instead of change

antpaw
A: 

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

Mark Good