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

Detailed explanation of the use of vue-resource interceptors

Preface Interceptor In some modern front-end fram...

The meaning and calculation method of QPS and TPS of MySQL database

When doing DB benchmark testing, qps and tps are ...

How to deploy Solidity smart contracts using ethers.js

If you have developed DApps on Ethereum, you may ...

JavaScript operation elements teach you how to change the page content style

Table of contents 1. Operation elements 1.1. Chan...

Mysql 5.6 "implicit conversion" causes index failure and inaccurate data

background When performing a SQL query, I tried t...

Two tools for splitting the screen in the Linux command line terminal

Here are two terminal split screen tools: screen ...

Summary of 7 pitfalls when using react

Table of contents 1. Component bloat 2. Change th...

Docker configuration Alibaba Cloud image acceleration pull implementation

Today I used docker to pull the image, but the sp...

The marquee element implements effects such as scrolling fonts and pictures

The marquee element can achieve simple font (image...

OpenLayers realizes the method of aggregate display of point feature layers

Table of contents 1. Introduction 2. Aggregation ...

How to install ionCube extension using pagoda

1. First install the pagoda Installation requirem...

6 Uncommon HTML Tags

First: <abbr> or <acronym> These two s...

Solution to the problem of var in for loop

Preface var is a way to declare variables in ES5....

Analysis of implicit bug in concurrent replication of MySQL 5.7

Preface Most of our MySQL online environments use...