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! |
>>: A detailed introduction to the CSS naming specification BEM from QQtabBar
Welcome to the previous canvas game series: 《VUE ...
1. Purpose Write a Flask application locally, pac...
This article shares the specific code of Vue3.0 h...
1. Why is eject not recommended? 1. What changes ...
Apache SkyWalking Apache SkyWalking is an applica...
Table of contents Introduction to Arrays Array li...
The database, like the operating system, is a sha...
This article records the installation and configu...
Table of contents Install Docker-ce for the devel...
As shown below: As shown above, just replace it. ...
nginx server nginx is an excellent web server tha...
Table of contents Preface Source code Where do I ...
SSH public key authentication is one of the SSH a...
Vue calls the PC camera to take pictures in real ...
Last time, we came up with two header layouts, on...