Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript jQuery on change event for dynamic select

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #166879
    jacorre
    Participant

    I’m having a problem attaching an on change event to a dynamic select drop down. I’m using jQuery v1.11.0.

    Everything I’ve read leads me to believe the following should work:

    $(document).on("change","select",function() {
      console.log($(this).val());
     });

    Doesn’t console anything. But if I use “focus” instead of “change” it consoles a value. Is this a bug with jQuery or am I doing something wrong?

    #166943
    Podders
    Participant

    @jacorre

    It should and does work http://codepen.io/Podders/pen/pkLig/ are you seeing something different, have and code samples or links to see?

    #166967
    Andy Howells
    Participant

    If this isn’t working then it’s usually because there’s a conflict or your script is dying on some incorrect code before it gets to this particular point.

    #167244
    jacorre
    Participant

    Thanks for the replies. I should probably mention that this is being used in Google Apps Script. I have an apps script web application written using the Html Service. I have not had a problem with any other dynamic elements triggering on events, except for the “change” event.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.