admin 管理员组文章数量: 1086019
I have a node defined by the following HTML markup:
<div id="_13:3AVAsa7qVvAprAar19ie8LRorrLEm2g" >asdf</div>
I need to get a reference to it without using it's full id like:
dojo.byId('_13:*');
Is it possible or is there any other ways that could be achieved?
I have a node defined by the following HTML markup:
<div id="_13:3AVAsa7qVvAprAar19ie8LRorrLEm2g" >asdf</div>
I need to get a reference to it without using it's full id like:
dojo.byId('_13:*');
Is it possible or is there any other ways that could be achieved?
Share Improve this question edited Jul 10, 2020 at 20:44 Jason Aller 3,65228 gold badges41 silver badges39 bronze badges asked May 24, 2011 at 9:03 vetri02vetri02 3,2998 gold badges37 silver badges43 bronze badges1 Answer
Reset to default 9You should use the attribute starts-with selector.
I've never used Dojo, but looking here:
http://dojotoolkit/reference-guide/dojo/query.html
It seems that you need this:
dojo.query('div[id^="_13:"]')
That same link also contains examples of other useful selectors at the end of the page.
本文标签: javascriptGet an element that has an ID which starts with some characters using DojoStack Overflow
版权声明:本文标题:javascript - Get an element that has an ID which starts with some characters using Dojo - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://roclinux.cn/p/1744096048a2532912.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论