语法<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表单中对数据进行分组?的详细内容。
