Attaching change event to Select element!
Unless I use the "browser default" class on the SELECT element, there is no way to attach a Jquery "Change" event to the materialized select element. Since the dropdown creates its own little span and it's a UL list of options rather than actual SELECT element options, it doesn't work, any idea how to accomplish that? Does the selector have those capabilities?
Just use onchange on the original element On Jan 7, 2015 7:58 PM, "ajrehman" [email protected] wrote:
Unless I use the "browser default" class on the SELECT element, there is no way to attach a Jquery "Change" event to the materialized select element. Since the dropdown creates its own little span and it's a UL list of options rather than actual SELECT element options, it doesn't work, any idea how to accomplish that? Does the selector have those capabilities?
— Reply to this email directly or view it on GitHub https://github.com/Dogfalo/materialize/issues/419.
It does work, thank you! My confusion was that, I was attaching a jquery change event to it which usually works for default SELECT elements but not for this one, for example:
$("#select-element").on("change", function(e) { .. });
Did not work, but instead if I added the "onchange" in place of the jquery "change" event like you mentioned:
Then it worked. I wondery why?
But thanks either way!
See #369 which should allow both to work now.