5
When click on "put", the field is filled with the information "changed", but when this happens, the Next change
does not identify this change.
In practice it doesn’t work, how can I make it work?
HTML
<button id="botao">Colocar</button>
<input id="campo">
jQuery
$('#botao').click(function(){
$('#campo').val('mudou');
})
$('#campo').change(function() {
alert('mudou mesmo');
});
When you change the value programmatically, the event
change
does not rotate. And you are using the wrong selector (#input
instead of#campo
). Why not do whatever you need right after assigning the value?– bfavaretto
Truth I made this mistake, but even putting the right name
campo
The problem still continues– David Costa