Home > front end >  How to let the <select> option to automatically start?
How to let the <select> option to automatically start?

Time:12-14

How to trigger & lt; Select> The option of full automatic start?

CodePudding user response:

Native & lt; Select> Elements cannot be achieved, you make a simulation using div + ul

CodePudding 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
  • Related