How to find inputs with an attribute name starting with specific letter or text using jQuery? Last Updated : 02 Jan, 2023 Summarize Comments Improve Suggest changes Share 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 find element with specific ID using 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 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 How to select ID that starts with certain character using jQuery ? Given an HTML document and the task is to select the elements with ID starts with certain characters using jQuery. Approach: Use jQuery [attribute^=value] Selector to select the element with ID starts with certain characters. Example 1: This example selects that element whose ID starts with 'GFG' an 2 min read How to set different color for each letter in a text field using jQuery ? In this article, we will find how to set a different color for each letter in a text field using jQuery? Approach: To do this we will have to change the color of text whenever the user enters a letter using the keyboard. For this, we will use onkeydown event that triggers whenever the user presses a 2 min read Like