0

I have a select element and want to simulate a click. The whole app is written in angularjs, but the trigger event is written in jquery. So I use the on() function like this:

$(document).on('click', '.fa', function() {
    $(this).siblings('select :selected').change();
});

I tried the change() function to pull down the select options. Unfortunatly it don't work. Maybe this JSFiddle helps for better understanding. Thanks for reply.

Alex
  • 927
  • 1
  • 12
  • 18
  • 3
    There must be angular way to achieve it. and your question is not clear what do you expect `.change()` will do. – Satpal Jul 24 '15 at 11:55
  • Thanks for reply. I tried the change() function to pull down the select options. – Alex Jul 24 '15 at 12:03
  • I'm not sure I understood, do you mean you want to get the value of the selected option? (when it is changed) Like this: [jsfiddle](https://jsfiddle.net/liviugc/3fapfm8e/) – verjas Jul 24 '15 at 12:08
  • 1
    Are you trying to simulate a click on the select to open it? – Matt Jul 24 '15 at 12:12
  • Yes, I want to simulate a click on the select. – Alex Jul 24 '15 at 12:13
  • See my answer below, using an out of the box select element to perform this isn't going to be fun for you. – Matt Jul 24 '15 at 12:18

0 Answers0