Selector Starts With:

$('input[name^=somePrefix]').doSomething();

Selector ENDS with:

$('input[name$=someSuffix]').doSomething();

In ASP.Net:

This is particularly useful in ASP.Net when you may not want to specify clientidmode static, but still want to use jQuery to find the ID. If the control's ID is txtMyTextbox and the ID in the DOM becomes something like SomePage_SomeControl_ucTestControl_txtMyTextBox, you can still select it by the part you know: txtMyTextbox:

$('input[id$=txtMyTextbox]').doSomething();
Published On: August 6, 2018Categories: ASP.Net, jQueryTags: ,