【发布时间】:2018-04-05 14:13:12
【问题描述】:
这个问题不言自明。
而不是像这样从自身捕获:this.getAttribute('id')) 或 this.id;是否可以从另一个标签中捕获属性?
编辑:
当然,点击一下:
假设:
<button onclick="Submit_Click("here I want to catch the attribute of another tag, not this one")">Save changes</button>
【问题讨论】:
-
“捕获”是什么意思?您始终可以通过
getElementById()、querySelector()等定位其他元素。 -
你能举例说明你想如何使用这段代码吗?
标签: javascript attributes getattribute