[英]The term for the text between the opening and the closing tag?
在<span>foo</span>
,引用foo
的正确术语是什么?
From the W3C XML Specification: 根据W3C XML规范:
Definition: The text between the start-tag and end-tag is called the element's content
定义:起始标签和结束标签之间的文本称为元素的内容
The content of the text child node of the <span>
element. <span>
元素的文本子节点的内容。
See quirksmode on this: 参见quirksmode :
So if you do
所以如果你这样做
<P>This is a paragraph</P>
you have created two nodes: an element P and a text node with content 'This is a paragraph'.
您已经创建了两个节点:元素P和内容为“这是一个段落”的文本节点。 The text node is inside the element, so it is considered a child node of the element.
文本节点位于元素内部,因此被视为元素的子节点。
Personally I call it content or text 我个人称之为内容或文字
The content in the span is foo
范围中的内容为foo
This sounds correct IMO. 这听起来是正确的IMO。
Quoting from w3schools 从w3schools报价
An XML element is everything from (including) the element's start tag to
(including) the element's end tag.
An element can contain other elements, simple text or a mixture of both.
Elements can also have attributes.
<bookstore>
<book category="CHILDREN">
<title>Harry Potter</title>
<author>J K. Rowling</author>
<year>2005</year>
<price>29.99</price>
</book>
<book category="WEB">
<title>Learning XML</title>
<author>Erik T. Ray</author>
<year>2003</year>
<price>39.95</price>
</book>
</bookstore>
In the example above, <bookstore> and <book> have element
contents, because they contain other elements. <author> has
text content because it contains text.
So, "text content" 因此,“文字内容”
I'd refer to it either as "content" or "text". 我将其称为“内容”或“文本”。
Given HTML as a markup language, you could also refer to it as "the described". 给定HTML作为标记语言,您也可以将其称为“描述的”。
Depends on context, to me. 对我来说,要视情况而定。
In Javascript it would be the innerHTML
property. 在Javascript中,它将是
innerHTML
属性。
In HTML it is simply content: 在HTML中,它只是内容:
<span>
is the start tag <span>
是开始标记 foo
is content foo
是内容 </span>
is the end tag </span>
是结束标记
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.