Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find an element by not exact id

There is an element with id looking like the following:

some_id_123456_some_id_id_id

where 123456 is an arbitrary number which is unknown. How do I find this element by id?

like image 894
Incerteza Avatar asked Jun 30 '14 12:06

Incerteza


1 Answers

You can do this by combining the both attribute starts with and ends with selector,

$('[id^=some_id][id$=_some_id_id_id]')
like image 105
Rajaprabhu Aravindasamy Avatar answered Sep 17 '22 17:09

Rajaprabhu Aravindasamy