Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
200 views
in Technique[技术] by (71.8m points)

html - remove select2 class from form

I add my own HTML element 'select' in Wordpress by Elementor and inside select some function from 'SELECT2' set automatically class 'select2-hidden-accessible'. In result my select doesn't open on mobile devices. And I don't know how I can remove this class - when I remove in console my select works. Or maybe can I set function to open my select. I tried remove it in JS but it doesn't work. I tried remove it in function select2 but it not works too. Please help me.

my code:

<select id="cat__mobile">
   <option value=""></option>
   <option value="opt1">opt1</option>
   <option value="opt2">opt2</option>
</select>

code in console:

<select id="cat__mobile" data-select2-id="cat__mobile" tabindex="-1" style="" class="select2-hidden-accessible" aria-hidden="true">
   <option value="" data-select2-id="5"></option>
   <option value="opt1">opt1</option>
   <option value="opt2">opt2</option>
</select>

question from:https://stackoverflow.com/questions/65625848/remove-select2-class-from-form

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Plugin id same now change the id on your side


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...