How can we group data in HTML form?

PHPz
Release: 2023-09-09 19:29:01
forward
1511 people have browsed it

How can we group data in HTML form?

We use the

tag to group related data in the HTML form. This tag creates a box around the relevant element on the web page. The tag is used within the
tag to provide a title for the group or to provide a name for the group.

How can we group data in HTML form?

grammar

<fieldse>…..</fieldset>
Copy after login

Example 1

The following is an example of using the tag to group data in an HTML form within a

tag -

<!DOCTYPE html>
<html>
<head>
   <meta charset="UTF-8">
   <meta name="description" content="meta tag in the web document">
   <meta name="keywords" content="HTML,CSS">
   <meta name="author" content="lokesh">
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
   <form>
      <fieldset>
         <legend>Employee Details</legend>
         Employee Name<br>
         <input type="text" name="Ename">
         <br>
         Employee ID<br>
         <input type="text" name="Eid">
         <br>
         Employee Address<br>
         <input type="text" name="Eid">
         <br>
      </fieldset>
   </form>
</body>
</html>
Copy after login

Example 2

You can try running the following code to group data in an HTML form -

<!DOCTYPE html>
<html>
<body>
   <form>
      <fieldset>
         <legend>Student Information:</legend>
         Student Name:<br>
         <input type="text" name="sname">
         <br>
         Student Subject:<br>
         <input type="text" name="ssubject">
         <br>
      </fieldset>
   </form>
</body>
</html>
Copy after login

The above is the detailed content of How can we group data in HTML form?. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!