0

I am trying to change the dropdown option value at the end from "10 rows" to "50 rows". The code below changes value to "50 rows" but it does not trigger the corresponding data. It's being run manually but not via JS. URL is https://trendlyne.com/mutual-fund/nav/6309/icici-prudential-technology-fund-direct-plan-growth/

document.querySelector('.select-wrap select').getElementsByTagName('option')[4].selected = 'selected';

OR

document.querySelector(".select-wrap select").value='50'
Ujjawal Bhandari
  • 1,231
  • 1
  • 8
  • 14

1 Answers1

1

trigger change event manually after selecting the value

document.querySelector('.select-wrap select').getElementsByTagName('option')[4].selected = true;
document.querySelector('.select-wrap select').dispatchEvent(new Event('change', {bubbles: true}));
mahindar
  • 520
  • 7
  • 20