我们如何在HTML表单中对数据进行分组?
我们使用2b5469ab79cf842344327415c3b3bb95标签,对HTML表单中的相关数据进行分组。该标签在网页上的相关元素周围创建一个框。 e911751791aa3ba95dc724e2fb905976 标签在 2b5469ab79cf842344327415c3b3bb95 标签内使用,为组提供标题或为组提供名称。
语法
<fieldse>…..</fieldset>
示例 1
以下是使用<legend>标签在<fieldset>标签内对HTML表单中的数据进行分组的示例 –
<!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>
示例2
您可以尝试运行以下代码来对HTML表单中的数据进行分组 –
<!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>
以上就是我们如何在HTML表单中对数据进行分组?的详细内容,更多请关注双恒网络其它相关文章!
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。