-1

I've got the following snippet of code on my webpage:

$('#activityFilter option').on('click', function() {
    var text = document.getElementById("tableFilter").value;
    searchTable(opts, text);
    $('.spotRow').first().click();
});

In my index.html file, there is a drop-down <select id="activityFilter">, and I'm trying to call searchTable whenever the user selects a new item on this drop-down. However, it seems like the .on('click') is never triggered in Chrome or Safari. However, it's working fine in Firefox and IE. Any suggestions?

Nicholas Tomlin
  • 195
  • 1
  • 3
  • 11
  • 3
    That's not really what that event is for. Why not use [`change`](https://api.jquery.com/change/)? – Mike Cluck Jun 22 '16 at 16:10
  • 1
    use onchange on the select id. Click may not fire properly in all browsers so it is not a good idea to use it. – NepCoder Jun 22 '16 at 16:11

1 Answers1

0

Try to use the jQuery's click instead of attaching an event

demarchisd
  • 734
  • 3
  • 16