The select drop-down menu selects the selected attribute by default and does not work

        When using the select tag to write the drop-down menu, the default selected "selected" of the option is invalid, and the default selection is not implemented.

First determine whether there is a property in the select that was changed during the first load in the script

Solution: Add the autocomplete="off" attribute to the select tag , turn off the auto-complete attribute, and refresh the page in the Firefox browser again. The attribute selected = " selected " is valid by default. Therefore, add the autocomplete="off" attribute every time you encounter a select tag .

code:

<select class="selectType" autocomplete="off">
  <option value="流畅" selected="selected">流畅</option>
  <option value="标清">标清</option>
  <option value="高清">高清</option>
  <option value="超清">超清</option>
</select>

Guess you like

Origin blog.csdn.net/frelly01/article/details/128463885