To find out all elements whose attribute value starts with certain characters we can use ^= operator. For Example:- <input id = "txtName" type = "text" data-id = "txt Name" />
<input id = "FirstNameF" type = "text" data-id = "name txt" />
<input type = "button" value = "Button" id = "btnTest" />
<script>
$(function () {
$("input[id^='tx']").css("border", "1px solid red");
});
</script>