HTML and CSS Reference
In-Depth Information
allow users to select five files, you had to place five separate file field controls on the web page. In HTML5,
however, users can select multiple files using a single file field control. This is possible with the new
multiple
attribute of the
<input>
element. Listing 9-1 shows how a file field control can be configured for
selecting a single and multiple files.
Listing 9-1.
File Field Control Markup
<input id="File1" type="ile" />
<input id="File2" type="ile" multiple="multiple" />
This listing shows two
<input>
elements with the
type
attribute set to
ile
. Notice that the second file
field has the
multiple
attribute. When you specify the
multiple
attribute, the resulting Open File dialog
allows you to select multiple files using standard Windows techniques (a combination of the Ctrl/Shift key
and mouse clicks).
The file fields are displayed differently by different browsers. For example, Figure 9-1 shows how the
file fields are displayed in Chrome, Opera, and Firefox.
Figure 9-1.
File fields in different browsers