Javascript 查找具有onmouseover的所有子元素
我有一个xpath,我想找到所有附加了onmouseover事件的子元素(甚至是嵌套的子元素)。我对Javascript和JQuery很陌生。有人能帮我吗 例如,在上,我想为第一个类为Javascript 查找具有onmouseover的所有子元素,javascript,onmouseover,Javascript,Onmouseover,我有一个xpath,我想找到所有附加了onmouseover事件的子元素(甚至是嵌套的子元素)。我对Javascript和JQuery很陌生。有人能帮我吗 例如,在上,我想为第一个类为crawgstars的元素获取带有onmouseover的所有子元素 $("yourElementSelector").mouseover(function(){ var children = $(this).children(); // OR $(this).children().each
crawgstars
的元素获取带有onmouseover
的所有子元素
$("yourElementSelector").mouseover(function(){
var children = $(this).children();
// OR
$(this).children().each(function(){
// DO something with each one...
});
});
您能提供一个代码示例吗?