" ."> How to set the default value of input in html-HTML Tutorial-php.cn

How to set the default value of input in html

青灯夜游
Release: 2021-12-10 16:45:58
Original
36350 people have browsed it

In HTML, you can use the value attribute to set the default value of input. The function of this attribute is to specify the initial (default) value of the input element displayed on the web page. The syntax is "".

How to set the default value of input in html

The operating environment of this tutorial: Windows 7 system, HTML5 version, Dell G3 computer.

In html, you can use the value attribute to set the default value of input.

The value attribute specifies the initial (default) value of theelement when it is displayed on the web page.

The value attribute has different usage for different input types:

  • For "button", "reset", "submit" types - define the text on the button

  • For "text", "password", "hidden" types - defines the initial (default) value of the input field

  • For "checkbox", "radio", "image" type - Defines the value associated with the input element that will be sent to the form's action URL when the form is submitted.

Note: The value attribute is required forand.

Example: HTML form with initial (default) value:

    
用户名:
密 码:
Copy after login

How to set the default value of input in html

Recommended tutorial: "html video Tutorial

The above is the detailed content of How to set the default value of input in html. 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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!