0

I am trying to set up a listener to fire when an elements id changes, I don't know if this is possible but here is my attempt (that isn't working).

$(".appSelect").on('change', function() {
   //fire change event
});

maybe something like :

$(".appSelect").attr("id").on('change', function() {

Is this possible in jquery?

Thanks!

ajmajmajma
  • 13,712
  • 24
  • 79
  • 133

1 Answers1

2

It's not possible with a listener because no event occurs. You'd have to periodically check the ID with a setInterval function or similar. Better, tie into the function that changes the ID with a callback.

isherwood
  • 58,414
  • 16
  • 114
  • 157