开发者

dojo query to get parents of all inputs

开发者 https://www.devze.com 2022-12-12 09:51 出处:网络
I\'m used to the jQuery style of selecting, which would be fairly easy in this case $(\"tbody td:has(input)\").click(...);

I'm used to the jQuery style of selecting, which would be fairly easy in this case

$("tbody td:has(input)").click(...);

But dojo seems to be using only regular CSS selectors, which开发者_开发问答 means I can't get a parent element.

I've tried to do this:

dojo.query("tbody td input").parentNode.onclick(...);

But that doesn't seem to work. Any ideas?


How about:

dojo.query("tbody td:contains(input)").onclick()


The latest versions of Dojo have a module to extend dojo.query: traverse. It contains also parent function.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号