MVC Edit View, JQuery change
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.
精彩评论