Select all text fields in css

Is there a way in CSS to select all type text input elements?

+6
source share
2 answers
input[type=text] { //css rules } 

This requires CSS 2.1 and will not work in some older browsers (e.g. IE6)

+9
source

In addition to what was mentioned

 input[type=text] { //css rules } 

No, I don’t think so, unless you manually mark them with one class and select them with a class.

Or you can try jQuery, something like:

 val text-inputs = $('input[type="text"]'); 

must complete the task;)

0
source

Source: https://habr.com/ru/post/886697/


All Articles