When the Option element in IE6/7/8 does not have a value, Select will get an empty string
When the change event is triggered, the test results in each browser are as follows:
IE6/7/8 : An empty string pops upIE9/Firefox/Safari/Chrome/ Opera : Pops up the innerText value of the corresponding option element. Obviously, the IE9/Firefox/Safari/Chrome/Opera implementation makes sense. That is, when the value of option is the same as the innerText of option, the value can be omitted and not written. This is more concise. Unfortunately, IE6/7/8 does not support writing this way. To ensure compatibility with all browsers, be sure not to omit the value attribute when writing options.
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