How to find inputs with an attribute name starting with specific letter or text using jQuery? Last Updated : 23 Jul, 2025 Comments Improve Suggest changes Like Article Like Report In this article, we will learn to find input with an attribute name starting with a specific letter or text. This task is implemented using attributeStartWith selector. attributeStartWith selector: This selector selects elements that have the specified attribute with a value beginning exactly with a given string. It has two arguments i.e attribute and value. Syntax: jQuery( "[attribute^='value']" )attribute: Name of the attribute.value: The value of an attribute (identifier or quoted string). The attributeStartWith selector can be useful for identifying elements in pages produced by server-side frameworks that produce HTML with systematic element ids. Example: Finds all inputs with an attribute name that starts with 'GFG' and puts the text in them. HTML <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <script src= "https://code.jquery.com/jquery-3.5.0.js"> </script> </head> <body> <h2 style="color:green">GeeksforGeeks</h2> <input name="GFGletter"> <input name="input2"> <input name="GFGtext"> <script> $( "input[name^='GFG']" ).val( "content here!" ); </script> </body> </html> Output: attribute value Comment More infoAdvertise with us Next Article How to check a string starts/ends with a specific string in jQuery ? K krishnanand3 Follow Improve Article Tags : Web Technologies JQuery HTML-Tags jQuery-Selectors jQuery-Questions +1 More Similar Reads How to check a string starts/ends with a specific string in jQuery ? JavaScript provides a lot of string methods that check whether a string is a substring of another string. So, jQuery wouldn't be necessary at all to perform this task. However, we will cover all the different ways of checking whether a string starts or ends with a string:Â startsWith() and endsWith() 5 min read How to check a string starts/ends with a specific string in jQuery ? JavaScript provides a lot of string methods that check whether a string is a substring of another string. So, jQuery wouldn't be necessary at all to perform this task. However, we will cover all the different ways of checking whether a string starts or ends with a string:Â startsWith() and endsWith() 5 min read How to check a string starts/ends with a specific string in jQuery ? JavaScript provides a lot of string methods that check whether a string is a substring of another string. So, jQuery wouldn't be necessary at all to perform this task. However, we will cover all the different ways of checking whether a string starts or ends with a string:Â startsWith() and endsWith() 5 min read How to Allow Only Special Characters and Spaces in Text Field Using jQuery ? We are going to create an input box that only contains the special characters and the space as the input. It will show an error if any other character is entered. We will use regular expressions that consist of only special symbols and spaces with different events in jQuery. Table of Content Using r 3 min read How to find element with specific ID using jQuery ? The question is to determine whether an element with a specific id exists or not using JQuery. jQuery on() Method: This method adds one or more event handlers for the selected elements and child elements.Syntax: $(selector).on(event, childSelector, data, function, map)Parameters: event: It is requir 3 min read How to find all button inputs and mark them using jQuery ? jQuery is a small and fast JavaScript library with a motto: "Write Less And Do More". To use JQuery you can either download the jquery library on your local machine or include the jquery library in your HTML code. Keep in mind that before learning JavaScript you have a basic knowledge of HTML, CSS, 2 min read Like