"."/> ".">

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

What is file in html5 form

WBOY
WBOYOriginal
2022-06-06 17:25:033708browse

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">

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>

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!

Statement:
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
Previous article:What is loop in html5Next article:What is loop in html5