THE WORLD’S LARGEST WEB DEVELOPER SITE

THE WORLD’S LARGEST WEB DEVELOPER SITE

< form action ='/action_page.php' >

  < label for ='male' > Male < /label >   < input type ='radio' name ='gender' id ='male' value ='male' > < br >   < label for ='female' > Female < /label >   < input type ='radio' name ='gender' id ='female' value ='female' > < br >   < label for ='other' > Other < /label >   < input type ='radio' name ='gender' id ='other' value ='other' > < br > < br >   < input type ='submit' value ='Submit' > < /form >

W3Schools is optimized for learning, testing, and training. Examples might be simplified to improve reading and basic understanding.

Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content.

While using this site, you agree to have read and accepted our terms of use ,

cookie and privacy policy .

Copyright 1999-2018 by Refsnes Data. All Rights Reserved.

Powered by W3.CSS .

The

The

However, it provides a usability improvement for mouse users, because if the

user clicks on the text within the

The for attribute of the

the related element to bind them together.

Tip: A label can be bound to an element either by using the ‘for’

attribute, or by placing the element inside the

The ‘form’ attribute is new in HTML5.

The

The

Most browsers will display the

Specifies which form element a label is bound to

Specifies one or more forms the label belongs to