国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

javascript - Safari dynamically assigning values ??to select does not take effect
大家講道理
大家講道理 2017-06-12 09:27:42
0
2
966

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.

大家講道理
大家講道理

光陰似箭催人老,日月如移越少年。

reply all(2)
大家講道理

When operating the attributes of option, please use prop to operate the attributes instead of attr

給我你的懷抱

This is a bug in Safari, solution:

<select multiple>
    <optgroup disabled hidden></optgroup>
    <option value="0">All</option>
    <option value="1">Test 1</option>
    <option value="2">Test 2</option>
    <option value="3">Test 3</option>
    <option value="4">Test 4</option>
</select>

Add an optgroup tag in front of all option tags, and give the attributes disabled and hidden

So easy!

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template