Use label tag to select the radio button by clicking the text

Use label tag to select the radio button by clicking the text
The <label> tag defines a label (tag) for an input element. The label element does not present any special effect to the user. However, it improves usability for mouse users. This control is triggered if you click on the text within the label element. That is, when the user selects the tag, the browser automatically shifts the focus to the form control associated with the tag. The for attribute of the <label> tag should be the same as the id attribute of the associated element

Example 1:

Copy code
The code is as follows:

<label for="man">
<input type="radio" value="男" name="man" id="man"/>
male
</label>
<label for="man2">
<input type="radio" value="女" name="man" id="man2"/>
female
</label>

Example 2:

Copy code
The code is as follows:

<input type="checkbox" name="Pages" value="Job" id="Job" ><label for="Job">Add and edit job information</label>

<input type="checkbox" name="Pages" value="JobQuery" id="JobQuery" &gt;<label for="JobQuery">Query and delete recruitment information</label>

<input type="checkbox" name="Pages" value="Technology" id="Technology" checked&gt;<label for="Technology">Add or modify technology items</label>

<<:  Sample code for using CSS to write a textured gradient background image

>>:  MYSQL METADATA LOCK (MDL LOCK) theory and lock type test

Recommend

Faint: "Use web2.0 to create standard-compliant pages"

Today someone talked to me about a website develo...

...

Implementation of scheduled backup in Mysql5.7

1. Find mysqldump.exe in the MySQL installation p...

Linux swap partition (detailed explanation)

Table of contents linux 1. What is SWAP 2. What d...

MySQL DML statement summary

DML operations refer to operations on table recor...

Ideas for creating wave effects with CSS

Previously, I introduced several ways to achieve ...

MYSQL slow query and log settings and testing

1. Introduction By enabling the slow query log, M...

Analysis of the problem of deploying vue project and configuring proxy in Nginx

1. Install and start nginx # Install nginx sudo a...

How to remove the blue box that appears when the image is used as a hyperlink

I recently used Dreamweaver to make a product pres...

CocosCreator classic entry project flappybird

Table of contents Development Environment Game en...

Detailed explanation of the principles and usage of MySQL stored procedures

This article uses examples to explain the princip...

Chrome monitors cookie changes and assigns values

The following code introduces Chrome's monito...

Solution to interface deformation when setting frameset height

Currently I have made a project, the interface is ...

How to operate the check box in HTML page

Checkboxes are very common on web pages. Whether ...