Sample code for html list box, text field, and file field

Sample code for html list box, text field, and file field

Drop-down box, text field, file field

The upper part is the demonstration effect and the lower part is the code

<form method="get" action="result.html">
<!--input: input box label, default is text, text box name: give the input box a name, used to submit data maxlength="8": the text box can enter up to 8 characters size="30": the length of the text box is 30px
-->
	<p>Username: <input type="text" name="username" value="text box initial value"
	maxlength="8" size="30"/></p>
<!-- Password box input type="password", the characters entered in the password box will be displayed as small dots-->
	<p>Password: <input type="password" name="pwd"/></p>
<!--radio: radio button value: initial value, radio button must be filled in name: group, otherwise the radio button will be wrong input tag needs to be closed-->
	<p>Gender:
	<input type="radio" value="boy" name="sex"/>Male <input type="radio" value="girl" name="sex"/>Female </p>
<!--checkbox: multiple-choice box value: the value corresponding to the option checked: selected by default, used in the input tag -->
	<p>Hobbies:
	<input type="checkbox" value="sleep" name="hobby"/>Sleep <input type="checkbox" value="code" name="hobby"/>Code <input type="checkbox" value="chat" name="hobby"/>Chat <input type="checkbox" value="game" name="hobby" checked/>Game </p>
<!--button: normal button type="image": picture button, replace the button style with a picture submit: submit button, submit the value of value to the value corresponding to name reset reset button, reset all input boxes value: the value of value is the name of the button -->
	<p>Button:
	<input type="button" name="btn1" value="Click to lengthen"/>
	<input type="image" src="1.jpg"/>
	</p>
<!--select: drop-down box label option: drop-down option label selected: selected by default, used in the drop-down box label -->
	<p>Country:
	<select name="country">
	<option value="cn" selected>China</option>
	<option value="usa">United States</option>
	<option value="uk">United Kingdom</option>
	<option value="jp">Japan</option>
	</select>
	</p>
<!--textarea: text area cols: the number of columns in the text area rows: the number of rows in the text area -->
	<p>Feedback:
	<textarea name="textarea" cols="50" rows="10">Text content</textarea>
	</p>
<!--type="file": file domain Note 1: The file domain is used to select files, and an upload button is also required Note 2: There are two names here. Uploading files submits the files to the files corresponding to the file domain
		It is not the upload button.
		That is to say, after selecting the file, value = the uploaded file, and after uploading, files = the uploaded file -->
	<p>File domain:
	<input type="file" name="files">
	<input type="button" value="Upload" name="upload">
	</p>
	
	<p>
	<input type="submit" value="Submit"/>
	<input type="reset" value="Reset"/>
	</p>
</form>

This concludes this article about sample codes for HTML list boxes, text fields, and file fields. For more HTML list box content, please search previous articles on 123WORDPRESS.COM or continue browsing the following related articles. We hope that you will support 123WORDPRESS.COM in the future!

<<:  Multiple ways to implement two-column layout with fixed width on the left and adaptive width on the right using CSS

>>:  A detailed introduction to the CSS naming specification BEM from QQtabBar

Recommend

VUE+Canvas implements the game of God of Wealth receiving ingots

Welcome to the previous canvas game series: 《VUE ...

Docker deployment of Flask application implementation steps

1. Purpose Write a Flask application locally, pac...

Vue3.0 handwritten carousel effect

This article shares the specific code of Vue3.0 h...

How to modify create-react-app's configuration without using eject

1. Why is eject not recommended? 1. What changes ...

Detailed explanation of Apache SkyWalking alarm configuration guide

Apache SkyWalking Apache SkyWalking is an applica...

A brief introduction to JavaScript arrays

Table of contents Introduction to Arrays Array li...

Causes and solutions for MySQL deadlock

The database, like the operating system, is a sha...

MySQL 8.0.24 version installation and configuration method graphic tutorial

This article records the installation and configu...

How to use Docker-compose to deploy Django applications offline

Table of contents Install Docker-ce for the devel...

Python3.6-MySql insert file path, the solution to lose the backslash

As shown below: As shown above, just replace it. ...

How to use nginx to intercept specified URL requests through regular expressions

nginx server nginx is an excellent web server tha...

How to monitor array changes in Vue

Table of contents Preface Source code Where do I ...

Detailed explanation of the basic usage of SSH's ssh-keygen command

SSH public key authentication is one of the SSH a...

Vue implements calling PC camera to take photos in real time

Vue calls the PC camera to take pictures in real ...

HTML5+CSS3 header creation example and update

Last time, we came up with two header layouts, on...