Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use optgroup in IOS to solve the problem that select is too long

Shulou Source: shulou.com Published: 2022-06-01 03:29:42 09月22日 Update

This article mainly introduces the relevant knowledge of how to use optgroup to solve the problem of select too long in IOS, the content is detailed and easy to understand, the operation is simple and fast, and it has a certain reference value. I believe you will gain something after reading this IOS article on how to use optgroup to solve the problem of select too long. Let's take a look at it.

IOS automatically reduces the font based on the length of the content in the select drop-down list to ensure that everything is displayed on one line. Although the optgroup tag is added to the HTML, the method of getting the select selected value through JQuery is not affected in any way. For example, we can still pass $('# sel_model'). Val () to get the selected value of the drop-down list.

The html after adding the optgroup tag looks like this:

Copy the code

Please select a car model

2018 Audi A3 30th anniversary model Sportback 35 TFSI enterprising model

2018 Audi A3 30th anniversary model Limousine 35 TFSI enterprising model

2018 Audi A3 30th anniversary Sportback 35 TFSI fashion model

2018 Audi A3 30th anniversary Limousine 35 TFSI fashion model

2018 Audi A3 30th Anniversary Sportback 35 TFSI Sport

This is the end of the article on "how to use optgroup to solve the problem of selecting too long in IOS". Thank you for reading! I believe you all have a certain understanding of "how to use optgroup to solve the problem of optgroup in IOS". If you want to learn more, you are welcome to follow the industry information channel.

Tags: Audi questions content knowledge fashion tags articles drop-down one line code value can be passed fonts easy to operate articles methods easy to understand more see industry Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi MySQL Microsoft Shulou Information NVidia