-2

I have a little jsFiddle: https://jsfiddle.net/1wkwdja7/

For some reason the change event is not firing when I set the value property of the inputField to "Barney". Typing text into the input field causes the event to fire but I need to have the event fire whenever the value property of the input changes, even if that property is changed programmatically, as it is in my example.

What am I doing wrong here?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Tom Baxter
  • 2,110
  • 2
  • 19
  • 38

1 Answers1

0

https://api.jquery.com/change/

as you can see in the yellow note changing the value with JavaScript wont fire the event. You can fire it using .trigger( "change" )

Gus
  • 942
  • 9
  • 32