I have some jquery-like function:
function(elem) {
return $('> someselector', elem);
};
The question is how can i do the same with querySelector()
?
The problem is >
selector in querySelector()
requires parent to be explicitly specified. Is there any workaround?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…