The Wayback Machine - https://web.archive.org/web/20240806052659/https://www.geeksforgeeks.org/html-title-attribute/
Open In App

HTML title Attribute

Last Updated : 10 May, 2023
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report

The title attribute is used to specify extra information about the element. When the mouse moves over the element then it shows the information. 

Supported Tags: It supports all HTML elements. 

Syntax: 

<element title = "text">

Attribute Value: This attribute contains single value text which is used as the tooltip text for an element. This title is associated with all HTML elements. 

Example: This example shows the use of the title attribute.

html




<!DOCTYPE html>
<html>
<head>
    <title>title attribute</title>
    <style>
        body {
            text-align: center;
        }
 
        h1 {
            color: green;
        }
    </style>
</head>
 
<body>
    <h1>GeeksforGeeks</h1>
    <h2>title attribute</h2>
 
    <p title="GeeksforGeeks: A computer science
              portal for geeks">
        GeeksforGeeks.org
    </p>
</body>
</html>


Output: 

 

Supported Browsers: The browser supported by title attribute are listed below: 

  • Chrome
  • Edge 12
  • Firefox
  • Opera
  • Safari

Previous Article
Next Article

Similar Reads

HTML &lt;abbr&gt; title Attribute
The HTML &lt;abbr&gt; title attribute is used to specify the extra information about an element. The &lt;abbr&gt; element represents an abbreviation or acronym. When the mouse moves over the element then it shows the information. Syntax&lt;abbr title = "text"&gt;Attribute ValueIt contains single-value text which is used as the tooltip text for an e
1 min read
How to Change the Style of &lt;a&gt; Tag Title Attribute ?
The style of &lt;a&gt; (anchor) tag title attribute is pre-defined for the browser and it may differ from one browser to the other. The webpage cannot display the changes in the tool-tip if based on the title attribute. The option is to make a false-tool-tip using CSS properties according to the wish. For doing this, the data-title attribute must b
2 min read
How to find the title attribute of the first emphasized element in the page using jQuery ?
In JavaScript, we have a lot of different libraries for different purposes. jQuery is also a part of the JavaScript library which is made to simplify the JavaScript codes, and you can do animation to make your website more creative as well as dynamic. Before learning jQuery library you must have a basic knowledge of HTML, CSS, and JavaScript. In th
2 min read
How href attribute is different from src attribute in HTML ?
In HTML5, the href and src attributes play distinct roles in defining paths or URLs, each associated with specific HTML elements. The href attribute, commonly found in an anchor (&lt;a&gt;) elements, points to the destination of hyperlinks, facilitating navigation. The src attribute, used with elements like &lt;img&gt; and &lt;script&gt;, specifies
1 min read
HTML DOM title Property
The DOM title property is used to return the title of the HTML document and also used to sets the value of the title in the document. This property is used to specify the information about the title. Syntax: It is used to return the title property document.titleIt is used to sets the title property document.title = newTitleProperty: The DOM title p
2 min read
HTML | DOM Title Object
The Title Object in HTML DOM is used to represent the HTML &lt;title&gt; element. The &lt;title&gt; element can be accessed by using getElementByTagName() method. Syntax: document.getElementByTagName(); Properties: The title object contains single property text which is used to set or return a text or content of title to the document.Example 1: C/C
2 min read
HTML | DOM Title text Property
The DOM Title text Property is used to set or return the text of the title of the document. Syntax: It returns the text property.titleObject.textIt is used to set the text property.titleObject.text = text Property Values: It contains the value i.e text which is used to specify the text of the document's title. Return Value: It returns a string valu
2 min read
How to get the title of an HTML page ?
In this article, we will see how to get the title of HTML page using JavaScript. There is a number of ways to do this but here we discuss a few of the most preferred methods. Example 1: This example gets the title of the document by using document.title property. C/C++ Code &lt;!DOCTYPE html&gt; &lt;html lang=&quot;en&quot;&gt; &lt;head&gt; &lt;tit
1 min read
How to get title of current HTML page using jQuery ?
Suppose you have given an HTML page and the task is to get the title of an HTML page with the help of only jQuery. There are two approaches that are discussed below: Approach 1: The $('title') jQuery selector is used to select the title element of the document and we can use text() method on the selector to get the title of the document. Example:
2 min read
HTML Page Title
HTML Page Title is essential for every web page. The main purpose of the HTML Title Page is to provide a meaningful title for your web page. The &lt;title&gt; tag is used to define the title. The text inside the &lt;title&gt; tag is rendered on the title bar of the browser. With the help of the title bar we generally identify the content of the web
2 min read
three90RightbarBannerImg