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 info K krishnanand3 Follow Improve Article Tags : Web Technologies JQuery HTML-Tags jQuery-Selectors jQuery-Questions +1 More Explore jQuery Tutorial 8 min read Getting Started with jQuery 4 min read jQuery Introduction 7 min read jQuery Syntax 2 min read jQuery CDN 4 min read jQuery SelectorsJQuery Selectors 5 min read jQuery * Selector 1 min read jQuery #id Selector 1 min read jQuery .class Selector 1 min read jQuery EventsjQuery Events 4 min read jQuery bind() Method 2 min read jQuery blur() Method 1 min read jQuery change() Method 2 min read jQuery EffectsjQuery animate() Method 2 min read jQuery clearQueue() Method 2 min read jQuery delay() Method 2 min read jQuery HTML/CSSjQuery addClass() Method 2 min read jQuery after() Method 1 min read jQuery append() Method 2 min read jQuery TraversingjQuery | Traversing 4 min read jQuery add() method 1 min read jQuery addBack() Method 2 min read Like