I am trying to find a span element who has an id in a particular pattern. Its main use is to find certain elements rendered by an asp.net (aspx) page which is derived from a master page.
I am trying to find a span element who has an id in a particular pattern. Its main use is to find certain elements rendered by an asp.net (aspx) page which is derived from a master page.
I know this is an old post, but additional information can help future developers who stumble across this. :) To add on to what @cdmckay mentioned, you can combine the attribute selectors to achieve "begins with X and ends with Y".
$("input[id^=inp][id$=_AddItem]")
This will match id "inp1_AddItem", "inp2_AddItem", "inp3_AddItem", etc.