CodePudding user response:
Native & lt; Select> Elements cannot be achieved, you make a simulation using div + ulCodePudding user response:
Oh ~ ~ ~ ~CodePudding user response:
CodePudding user response:
<script>
Let $sel1=document. GetElementById (" select1 ")
Select1. AddEventListener (" mousedown ", function () {
if (! Enclosing the getAttribute (" multiple ")) enclosing setAttribute (" multiple ", true)
}, false)
Select1. AddEventListener (" change ", function () {
Enclosing removeAttribute (" multiple ")
}, false)
Select1. AddEventListener (" mouseleave ", function () {
Enclosing removeAttribute (" multiple ")
}, false)
</script>
CodePudding user response:
Native seems no use Li or a simulated one