CSS attribute selector is used to targeting an input text fields. The input text fields of type ‘text’ can be targeting by using input[type=text].
Note: It is specified that the default attribute values may not always be selectable with attribute selectors, one could try to cover other cases of markup for which text inputs are rendered.
- input:not([type]): It is used when type attribute is not present in the markup.
- input[type = “”]: It is used when type attribute is present, but empty.
- input[type = text]: It is used when type attribute is explicitly defined as ‘text’.
Example 1: This example selects the input text fields and use some CSS property.
Example 2: This example selects the input text fields and use some CSS property.
- How to add input fields dynamically on button click in AngularJS ?
- HTML | DOM Input Text select() Method
- Text Animation with changing the color of the text using HTML & CSS
- How to create long shadow of text without using text-shadow in HTML and CSS ?
- How to make text input non-editable using CSS?
- How to select text nodes using jQuery ?
- How to select all on focus in input using JQuery?
- How to Select Multiple Files using HTML Input Tag ?
- jQuery | :text Selector
- Sort array of objects by object fields in PHP
- Intermediate fields in Django | Python
- Python | Relational fields in Django models
- Difference between private keyword and private fields in TypeScript
- How to add space (" ") after an element using :after selector in CSS ?
- jQuery | :input Selector
- How to select all child elements recursively using CSS?
- How to select elements by data attribute using CSS?
- How to select all children of an element except the last child using CSS?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.