Computer >> Computer tutorials >  >> Programming >> Javascript

What is the difference between an acronym and abbr tags?


In layman language, an acronym is a word formed by taking letters of each word in a phrase to form an abbreviation. Acronyms are a subset of abbreviations i.e. abbreviation is a shortened form of a word.

The <acronym> tag isn’t supported in HTML5 and is deprecated now. Do not use. To add abbreviation in HTML, use the <abbr> tag. Both abbreviation and acronym are the shortened versions and are represented as a series of letters. Some of the examples include, "Mr.", "IST", "MRI", “NASA”, “ISRO” etc. 

What is the difference between an acronym and abbr tags?

Example

You can try to run the following code to add abbreviation in HTML.

<!DOCTYPE html>
<html>
   <head>
      <title>HTML abbreviation</title>
   </head>
   <body>
      <h1>Space Exploration</h1>
      <p>US Space Explorations are governed by <abbr title="National Aeronautics and Space           Administration">NASA</abbr>.
      </p>
   </body>
</html>