2011-01-11 142 views

回答

3

<span>元素的文本子節點的內容。

quirksmode在此:

所以,如果你

<P>This is a paragraph</P>

創建了兩個節點:一個元素P和與內容的文本節點「這是一個段落」。文本節點位於元素內部,因此它被視爲元素的子節點。

+0

「與內容的文本節點」 ......這是否預設了文本節點不是內容,內容是......內容? – 2011-01-11 15:49:57

+0

@Jamie Dixon - 這意味着文本節點可以是空的。如果它不是空的,它有內容。 – Oded 2011-01-11 15:51:09

2

個人而言,我把它叫做內容或文本

跨度中的內容是富

這聽起來很正確的IMO。

0

我會將它稱爲「內容」或「文本」。

將HTML作爲標記語言,您也可以將其稱爲「所描述的」。

1

從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. 

引用所以, 「文本內容」

+1

w3schools有太多的錯誤和不準確的地方被認爲是任何權威... – Oded 2011-01-11 15:54:43

0

取決於上下文,對我來說。

在Javascript中它將是innerHTML財產。

在HTML中它僅僅是內容:

  • <span>是開始標籤
  • foo內容
  • </span>是結束標籤
相關問題