-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinput_attributes.html
More file actions
290 lines (289 loc) · 9.96 KB
/
Copy pathinput_attributes.html
File metadata and controls
290 lines (289 loc) · 9.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" href="assets/html5.png" type="image/x-icon">
<title>Input Attributes</title>
<style>
/* agrupo por clases para crear estilos */
html{
font-family: Verdana, Geneva, Tahoma, sans-serif;
}
div{
padding-left: 0.5cm;
}
label{
display: block;
font-weight: bold;
}
textarea{display: block;}
.code-text{
padding-left:20%;
}
button{
margin: 0% 49%;
}
</style>
</head>
<body>
<div>
<a href="index.html">
<button>BACK</button>
</a>
<h1 style="text-align: center;">INPUT ATTRIBUTES</h1>
</div>
<div>
<h2>VALUE</h2>
<p>The value attribute on an <input> tag sets the value of the element.</p>
</div>
<div>
<h3>EXAMPLE</h3>
<code class="code-text">
<input type="text" id="school" name="school" value="Assembler">
</code>
<p>Input type "text" with a value="Assembler"</p>
<label for="school">School:</label><br>
<input type="text" id="school" name="school" value="Assembler"/>
</div>
<br>
<hr>
<br>
<div>
<h2>READONLY</h2>
<p>The readonly attribute on an <input> tag specifies that the input element is read-only, which means the field is non-editable.</p>
</div>
<div>
<h3>EXAMPLE</h3>
<code class="code-text">
<input type="text" id="book" name="book" value="The world of yesterday" readonly>
</code>
<p>Input type "text" with a value="The world of yesterday"</p>
<label for="book">Title Book:</label><br>
<input type="text" id="book" name="book" value="The world of yesterday" readonly/>
<p><strong>Note:</strong> The field is not editable, but its value is including during form submission.
</div>
<br>
<hr>
<br>
<div>
<h2>DISABLED</h2>
<p>The disabled attribute on an <input> tag disables the input element.</p>
</div>
<div>
<h3>EXAMPLE</h3>
<code class="code-text">
<input type="text" id="name" name="name" disabled>
</code>
<p>Input type "text" with no value and disabled.</p>
<label for="name">Name:</label><br>
<input type="text" id="name" name="name" disabled/>
<p><strong>Note:</strong> The input field is not usable and its value is not included during form submission.
</div>
<br>
<hr>
<br>
<div>
<h2>SIZE</h2>
<p>The size attribute on an <input> tag defines the character width of the element.</p>
</div>
<div>
<h3>EXAMPLE</h3>
<code class="code-text">
<input type="text" id="subject" name="subject" value="Mathematics" size="25">
</code>
<p>The textbox is 25 characters wide.</p>
<label for="subject">Subject:</label><br>
<input type="text" id="subject" name="subject" value="Mathematics" size="25"/>
<p><strong>Note:</strong> The input field has 25 characters visibles.
</div>
<br>
<hr>
<br>
<div>
<h2>MAXLENGHT</h2>
<p>The maxlength attribute on an <input> tag specifies the maximum number of characters that can be entered in the input field.</p>
<p>Default is 524,288 characters.</p>
</div>
<div>
<h3>EXAMPLE</h3>
<code class="code-text">
<input type="text" id="city" name="city" maxlength="10"/>
</code>
<p>The input text allows to introduce 10 characters.</p>
<label for="city">City:</label><br>
<input type="text" id="city" name="city" maxlength="10"/>
</div>
<br>
<hr>
<br>
<div>
<h2>MIN AND MAX</h2>
<p>The min attribute on an <input> tag sets the minimum value for that element.</p>
<p>The max attribute on an <input> tag sets the maximun value for that element.</p>
</div>
<div>
<h3>EXAMPLE</h3>
<code class="code-text">
<input type="text" id="quantity" name="quantity" min="1" max="10" value="3">
</code>
<p>Values between 1 and 10.</p>
<label for="quantity">Quantity:</label><br>
<input type="number" id="quantity" name="quantity" min="1" max="10" value="3"/>
</div>
<br>
<hr>
<br>
<div>
<h2>MULTIPLE</h2>
<p>The multiple attribute is a boolean attribute.
When present, it specifies that the user is allowed to enter/select more than one value.</p>
</div>
<div>
<h3>EXAMPLE</h3>
<code class="code-text">
<input type="file" id="files" name="files" alt="No file choosen" multiple >
</code>
<p>Try to select more than one file:</p>
<label for="files">Select files:</label>
<input type="file" id="files" name="files" multiple /><br>
<input type="submit">
</div>
<br>
<hr>
<br>
<div>
<h2>PATTERN</h2>
<p>The pattern attribute on an <input> tag specifies a regular expression which validates the input data before form submission.</p>
</div>
<div>
<h3>EXAMPLE</h3>
<code class="code-text">
<input type="text" id="idcard" name="idcard" pattern="[0-9]]{8}[A-Z]"/>
</code>
<p>Introduce your national identity card:</p>
<input type="text" id="idcard" name="idcard" pattern="[0-9]]{8}[A-Z]"/>
</div>
<br>
<hr>
<br>
<div>
<h2>PLACEHOLDER</h2>
<p>The placeholder attribute specifies a short hint that describes the expected value of an input field.</p>
</div>
<div>
<h3>EXAMPLE</h3>
<code class="code-text">
<input type="text" id="idnumber" name="idnumber" placeholder="e.g, 99999999X" pattern="[0-9]]{8}[A-Z]">
</code>
<p>Introduce your national identity card:</p>
<input type="text" id="idnumber" name="idnumber" placeholder="e.g, 99999999X" pattern="[0-9]]{8}[A-Z]"/>
</div>
<br>
<hr>
<br>
<div>
<h2>REQUIRED</h2>
<p>The required attribute on an <input> tag specifies that data must be provided before submitting the form.</p>
</div>
<div>
<h3>EXAMPLE</h3>
<code class="code-text">
<input type="text" id="firstname" name="firstname" required>
</code>
<label for="firstname">First name</label><br/>
<input type="text" id="firstname" name="firstname" required/><br/>
</div>
<br>
<hr>
<br>
<div>
<h2>STEP</h2>
<p>The step attribute on an <input> tag sets the stepped increment value for the input element.</p>
</div>
<div>
<h3>EXAMPLE</h3>
<code class="code-text">
<input type="number" id="numberstep" name="numberstep" step="5">
</code>
<br><br>
<label for="numberstep">The number control increments and decrements in intervals of 5.</label><br/>
<input type="number" id="numberstep" name="numberstep" step="5"/>
</div>
<br>
<hr>
<br>
<div>
<h2>AUTOFOCUS</h2>
<p>The autofocus attribute sets focus to the input element upon page load.</p>
</div>
<div>
<h3>EXAMPLE</h3>
<code class="code-text">
<input type="text" id="entername" name="entername" placeholder="Enter your name" autofocus>
</code>
<input type="text" id="entername" name="entername" placeholder="Enter your name" autofocus/>
</div>
<br>
<hr>
<br>
<div>
<h2>HEIGHT AND WIDTH</h2>
<p>The height attribute specifies the height of the element, in pixels.</p>
<p>The width attribute specifies the width of the element, in pixels.</p>
</div>
<div>
<h3>EXAMPLE</h3>
<code class="code-text">
<canvas id="myCanvas" width="200" height="200" style="border:1px solid><canvas>
</code>
<p>Canvas's size 200x200</p>
<canvas id="myCanvas" width="200" height="200" style="border:1px solid"></canvas>
</div>
<br>
<hr>
<br>
<div>
<h2>LIST</h2>
<p>The list attribute on an <input> tag associates the input element with a <datalist>.</p>
</div>
<div>
<h3>EXAMPLE</h3>
<pre class="code-text">
<code>
<input list="favplaces" name="favplaces" id="places">
<datalist id="places">
<option value="Playa">
<option value="Montaña">
<datalist>
</code>
</pre>
<label for="places">Choose one option:</label><br>
<input list="favplaces" name="favplaces" id="places"/>
<datalist id="favplaces">
<option value="playa">
<option value="Montaña">
</datalist>
</div>
<br>
<hr>
<br>
<div>
<h2>FORM</h2>
<p>The form attribute specifies the form the element belongs to.</p>
</div>
<div>
<h3>EXAMPLE</h3>
<code class="code-text">
<input form="myform" type="text" name="lastname" placeholder="Last name">
</code>
<p>This input text is associated with "myform" forms</p>
<form id="myform"></form>
<input form="myform" type="text" name="lastname" placeholder="Last name"/>
</div>
<a href="index.html">
<button>BACK</button>
</a>
</body>
</html>