Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 HTML 中,我们有 element <strong></strong>。我们有开始标签<strong>和结束标签</strong>,但是我们如何引用尖括号之间的文本呢?
<strong></strong>
<strong>
</strong>
<strong> </strong> ^ ^ these texts
因此,如果我们删除该<> and </>标签的文本部分引用为什么?标识符?一个符号?谁能帮我?
<> and </>
我会说这是标签名称。
您可以使用 JavaScript 在 JavaScript 中访问它Element.tagName()。
Element.tagName()
另请参阅:HTML 标记和元素之间有什么区别?
Hevenard 给了我正确的答案。标记内的文本称为标记名。
它被称为 an element,与图像、文本框和段落等其他元素非常相似。您也可以将其称为tag.
element
tag
据 W3Schools 称,
该元素用于识别比周围文本更重要的文本。
https://html.com/tags/strong/