Home > Web Front-end > CSS Tutorial > Can HTML Tags Be Used Within Select Element Options?

Can HTML Tags Be Used Within Select Element Options?

Patricia Arquette
Release: 2024-12-21 01:15:12
Original
652 people have browsed it

Can HTML Tags Be Used Within Select Element Options?

HTML Tags in Select Element Options

Can HTML tags be incorporated into the options of a HTML select element?

Consider the following code:

<select>
    <option value="one"><b>one is bold</b></option>
    <option value="two">two has some <span>
Copy after login

Ideally, the options would be rendered in HTML, preserving the formatting. However, this is not possible.

Explanation

The above is the detailed content of Can HTML Tags Be Used Within Select Element Options?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template