<fieldset> nhóm các form controls có liên quan nhau, tạo border visual và semantic grouping. <legend> là tiêu đề mô tả cho nhóm đó.
- Đặc biệt quan trọng cho nhóm radio/checkbox: screen readers đọc legend trước mỗi option (ví dụ: 'Giới tính: Nam / Nữ').
- Có thể dùng
disabledtrên<fieldset>để disable toàn bộ group inputs bên trong. Ứng dụng: form đăng ký nhiều section (Thông tin cá nhân, Địa chỉ, Thanh toán).
<fieldset> groups related form controls, adding a visual border and semantic grouping. <legend> is the descriptive title for the group.
- Especially important for radio/checkbox groups: screen readers read the legend before each option (e.g., 'Gender: Male / Female').
- You can apply
disabledto a<fieldset>to disable all inputs inside it at once. - Use case: multi-section registration forms (Personal Info, Address, Payment).