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?
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?
2 Answers
Reset to default 21You can do this by bining the both attribute starts with
and ends with
selector,
$('[id^=some_id][id$=_some_id_id_id]')
You can use Jquery selectors for this:
Combine Attribute Ends With Selector and Attribute Starts With Selector selectors:
$('[id^=some_id][id$=_some_id_id_id]')