dimanche 24 juillet 2016

Blur() doesn't work for this situation?

Here's my code:

<input id="m" autocomplete="off"/>

and I put the following lines in script

$('#m').on('blur', alert('blurred'););
$('#m').on('focus', alert('focused'););

The result is, it will pop up 'blurred' when the page starts. But afterward, it no longer fires the alert('blurred').

More interesting is, the focus() works well.

Thanks for any suggestion or help.

Aucun commentaire:

Enregistrer un commentaire