Home  >  Article  >  Web Front-end  >  Solution to the invalid attribute of option tag selected="selected"

Solution to the invalid attribute of option tag selected="selected"

小云云
小云云Original
2017-12-28 09:11:442665browse

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn