I try to detect text changing in live on an input text. Here is my attempt to do this :
This code is for JQuery includes version.
<script src="http://code.jquery.com/jquery-1.9.0.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.0.0.js"></script>
This code is for the form. Like you will see, a simple form with 2 input text (id and password) and a button.
<form method='post'>
<input type="text" name="id" id="id" placeholder="mail adress" />
<input type="text" name="pass" id="pass" placeholder="password" />
<input type="submit" name="login" id="login" value="login" />
</form>
And finally the JQuery code that seems not working. I placed it in the <body></body>
which also contains my form.
<script type='text/javascript'>
$('#id').on('input', function () {
alert('text changed');
});
</script>
This short code doesn't seems to work. I followed a precedent question asked in this site, but this solution didn't help me.
The most strange thing is that it works when I copy paste this code in a snippet, but doesn't with a simple html file located in my PC. So I think the problem come from my jquery includes, possibly..
May someone light my lantern ?