Home > Web Front-end > Front-end Q&A > What is file in html5 form

What is file in html5 form

WBOY
Release: 2022-06-07 16:23:45
Original
3700 people have browsed it

In HTML5, file is the attribute value of the type attribute in the input element. The type attribute specifies the type of input element to be displayed. When the attribute value is set to "file", you can define the file selection field and "browse" Button for file upload, the syntax is "".

What is file in html5 form

The operating environment of this tutorial: windows10 system, html5 version, Dell G3 computer.

What is file in the html5 form

file is the attribute value of the type attribute in the input element

Define the file selection field and "Browse.. ." button for file upload.

The type attribute specifies the type of element to be displayed.

The default type is: text.

Tip: This attribute is not required, but we think you should always use it.

The syntax is:

<input type="value">
Copy after login

The example is as follows:

<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
<title>123</title> 
</head>
<body>
<form action="demo-form.php">
  选择一个文件: <input type="file" name="img">
  <input type="submit">
</form>
</body>
</html>
Copy after login

Output result:

What is file in html5 form

(Learning video Share: css video tutorial)

The above is the detailed content of What is file in html5 form. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template