To find out all elements whose attribute value starts with certain characters we can use ^=
operator.
<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>
Above jQuery code block would first select all input element and then filter elements whose id attribute starts with "tx" that select only first input element as only first input "id" attribute starts with "tx" characters.
Views: 7914 | Post Order: 22