【发布时间】:2011-10-23 06:23:00
【问题描述】:
sn -p "A" 有什么区别:
<root>
<item id="1">
<attr1> foo </attr1>
<attr2> bar </attr2>
</item>
</root>
并将“id”属性放在sn-p“B”中的元素内:
<root>
<item>
<id> 1 </id>
<attr1> foo </attr1>
<attr2> bar </attr2>
</item>
</root>
假设我已经可以使用 DOM 的 createElement() 和 appendChild ?
谢谢!
【问题讨论】:
-
(google) when+to+use+attributes+vs+elements
-
我不知道实际的术语,我很抱歉