HTML Underline text can be done using the HTML U tag, but the semantics of U HTML Tag have changed a lot in HTML 5.
U tag was earlier used for showing underlined text but was then deprecated in HTML 4.01.
U tag was again introduced in HTML 5 with a very different semantic of defining text which can be different from normal text e.g. incorrectly spelled words.
Even though U Tag has been introduced again, still most of the browsers will use the HTML U Tag to display the text wrapped in it as underlined text.
HTML U Tag Syntax
<u> Some text here </u>
HTML U Tag Example
|HTML U Tag Code||Output|
This is a normal text <span style="text-decoration: underline;"> This text is in U Tag </span>
|This is a normal text
This text is in U Tag
Here in the example above we can see that even though the semantics of HTML U tag have changed in HTML 5, still the browser is using the HTML U Tag to show HTML underline text.
HTML U Tag supports all HTML Global Attributes and HTML Event Attributes
HTML U Tag Supporting Browsers