【发布时间】:2011-05-18 23:12:26
【问题描述】:
我想使用 jquery 从页面中获取名称,以便我可以将它们用作变量。
例子:
Tags:
<title>Item Name</title>
<price>$10.00</price>
$tag_name[0] = first tag (this is where jquery code would go)
$tag_name[1] = second tag (this is where jquery code would go)
$item_array[$tag_name[0]][0] = "item name";
$item_array[$tag_name[1]][0] = "$10.00";
如何获取标签的实际名称?我知道如何获取内容。
【问题讨论】:
-
你如何识别哪个标签包含哪个数据?按文档中的位置?在一些包含元素内?等
-
@Rob Raisch - 标签都是
- 的后代。
-
您的代码甚至没有接近 Javascript。