This article mainly brings you an article to solve the problem of invalid option tag selected="selected" attribute. The editor thinks it’s pretty good, so I’ll share it with you now and give it as a reference. Let’s follow the editor to have a look, I hope it will be helpful to everyone.
To add autocomplete="off" to the select tag, otherwise the browser will After the first refresh, the option when it was last closed will be automatically selected, so the default attribute selected="selected" will become invalid
Remember that every time you encounter a select tag, it is best to add autocomplete="off"This item is very short
An article, I hope it can help you solve the problem.
Related recommendations:
How JavaScript dynamically sets the selected instance analysis of Option in Select
html: option tag can Is there an a tag?
#Examples of disabling selection and select disabling options in the option tag in html
The above is the detailed content of Solution to the invalid attribute of option tag selected='selected'. For more information, please follow other related articles on the PHP Chinese website!