Omit type = "text" on input that is considered bad practice?

I have an HTML page that is too messy, so I'm trying to crop it.

I always put type='text'on my inputs when they are text inputs:

<input type="text" />

However, the browser does not seem to need this.

Omit this attribute, where is text considered bad practice?

+4
source share
4 answers

To answer this question, we can turn to:

HTML4 SPEC 17.4 INPUT Element

type = text | password | Check box | radio | send | reset | File | tucked away | image | [CI] button This attribute defines the type of control to be created. The default value for this attribute is text.

HTML5 4.10.5

type ( ) . . .

, .

+3

type , - text, HTML ( HTML 2.0) . , , , , .

DOM, <input> <input type=text>, ( type node 'text'), , attributes type. JavaScript, type, .

, input , , HTML-, , , , , , , type .

, , , type=text. CSS input[type=text] , type=text. , , input. .

+4

, . , " ", , //, .

+1

If you look at modern browsers, they are sure to handle it. But if your users use older browsers (especially IE-older ones), then the gods know what will happen .;)

0
source

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


All Articles