0

This syntax is able to change the Select option but then clicking on Submit button is doing nothing:

 $('#nbSelect  option[value="' + user_selections.bid_details.paytm_bank_2nd + '"]')
 .prop('selected', true);

How to simulate this selection as real user selection when page is using AngularJS using Javascript?

georgeawg
  • 48,608
  • 13
  • 72
  • 95
user5858
  • 1,082
  • 4
  • 39
  • 79
  • If you're using Angular, you largely **shouldn't** be using jQuery at the same time. If you're editing *someone else's* Angular page via an extension, then you'll need to access `item.selectedVariant` per the linked answer. – ceejayoz Apr 11 '19 at 20:42
  • All answers in the linked topic seem completely irrelevant here since an extension can't just change the internal state that's not exposed via a global variable. Instead you can try to fire the change event in the hopes the page processes it: $('your selector')[0].dispatchEvent(new Event('change', {bubbles: true})) – wOxxOm Apr 12 '19 at 05:00
  • @ceejayoz [Change value of wrapped select, that was dynamically created by AngularJs from Chrome content script](//stackoverflow.com/a/37348526) is the proper target, apparently. – wOxxOm Apr 12 '19 at 05:52

0 Answers0