Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Word meaning the text between opening and closing HTML tags

In HTML there are tags such as
<div id="abc">TEXT HERE</div> What would you cal lthe text here part? I thought about calling it value, but value itself is an attribute of a tag.

like image 425
Megan Walker Avatar asked Sep 15 '25 13:09

Megan Walker


2 Answers

Everything from the start tag to the end tag is an "HTML Element" The bit you refer to is the element content

like image 127
Steve Mallam Avatar answered Sep 18 '25 06:09

Steve Mallam


It depends, on what exactly you are referring to:

  • Is it anything that's within the <div> tag?
  • Is it just the text within the <div> tag?
  • Is it just the first text node within the <div> tag?
  • Are you talking about HTML as a language, or about a DOM model of HTML, or about an API accessing the HTML?
  • ...

The question is not so easy to answer. Some examples:

  • With JavaScript, you can use innerText to refer to the text content, whereas you would use innerHTML to refer to any HTML content.
  • With a DOM library like Dom4j, the generic term for the string within an element is determined by getStringValue()
  • With XSLT, you can use the string() method to retrieve the text
  • ...

My personal answer would be to call it the (inner) text of an element.

like image 23
Chris Lercher Avatar answered Sep 18 '25 06:09

Chris Lercher