I need to dynamically obtain the value of the option selected by the user from the background and then dynamically assign the value to the select when the user enters this page again
This method can take effect in chrome, but it cannot take effect in safari. I hope you can help me.
When operating the attributes of option, please use prop to operate the attributes instead of attr
This is a bug in Safari, solution:
Add an
optgroup
tag in front of alloption
tags, and give the attributesdisabled
andhidden
So easy!