Open In App

HTML <plaintext> Tag

Improve
Improve
Like Article
Like
Save
Share
Report

HTML(HyperText Markup Language) is used to design web pages using a markup language. It is a combination of both hypertext and markup language. HTML uses different types of tags to create web pages and <plaintext> tag is one of them. The <plaintext> tag is used to display all the text in the document as it was initially typed in. Or in other words, this tag ignores all the formatting and displays all the text present below this tag including tag and document tags. This tag, can’t be turned off, and can’t be stopped. Everything below the <plaintext> tag is shown below as it is, it does not have a closing tag or we can say that it is an empty tag.

Note: This tag has been deprecated since HTML2 and is not recommended to use. Instead of this, you can use <pre> tag or the <code> tag as a better alternative for this. 

Syntax:

<plaintext>

Example 1:

HTML




<!DOCTYPE html>
<html>
    <head>
    <title>Page Title</title>
    </head>
<body>
    <h2>Welcome To GFG</h2>
    <plaintext>
        It is an online learning platform
</body>
</html>


Output:

Here we can see, after the plaintext tag, everything below it is shown, totally plain, without any editing, and it also might ignore the external CSS if applied onto the HTML file.

Example 2:

HTML




<!DOCTYPE html>
<html>
    <head>
    <title>Page Title</title>
    </head>
<body>
    <h2>Welcome To GFG</h2>
    <plaintext>
        It is an online learning platform
        <b>GeeksforGeeks</b>
</body>
</html>


Output:



Last Updated : 17 Jul, 2023
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads