Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get an element that has an ID which starts with some characters using Dojo

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?

like image 222
vetri02 Avatar asked Dec 08 '25 20:12

vetri02


1 Answers

You should use the attribute starts-with selector.

I've never used Dojo, but looking here:
http://dojotoolkit.org/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.

like image 186
thirtydot Avatar answered Dec 11 '25 08:12

thirtydot



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!