Any way to define selected inside <select> tag rather than on

后端 未结 5 1703
-上瘾入骨i
-上瘾入骨i 2021-01-21 13:16

I have a weird html option list which I dont want to check each value to make it selected or not see the list below

 element to specify this: it's not part of the HTML specification. What you can do is give each option element an id and then use Javascript to set the right option element(s) as selected. In PHP, you would need to output the script snippet in the right place to get the browser to run it.

For example


...

提交回复
热议问题