我用于document.activeElement.href
获取点击标签的目标位置。它在 Firefox 中有效,但在 chrome 中无效。
我想"href"
在它之外的其他功能中获取单击(活动)元素的位置。
像这样:
function animate() {
alert(document.activeElement.href); //not working in chrome
});
非常感谢
编辑:请记住,我不想使用“this”或 $(this),因为它在元素之外的函数中不起作用。我知道我可以使用onclick="...."
然后使用"$(this)"
每个元素,但我不想要这个。
我的问题很简单:
我可以在它之外的函数中获得 clicked(active) elementID 吗?(火狐除外)