dynamic dropdown menu selected value retain if refresh

my search page using dropdown menu dynamic. but press goto 2nd page button only retain main category selected value only. its mean in second page view all data in main category selected. how set sub category (item) selected value retain as like that. thank you.

using code here can see

enter image description here

const mySel = document