我的代码:
var parent = document.createElement('div');
var pen = document.createElement('div');
var dog = document.createElement('div');
dog.className = "dog";
pen.appendChild(dog);
parent.appendChild(pen);
dojo.query("> *", parent).forEach( function(node){
if(node.className == "dog")alert('bark');
});
dojo.query("> .dog", parent).forEach( function(node){
alert('bark');
});
我没有收到警报“吠叫”。我究竟做错了什么?