Câu hỏi tự luận mức độ vận dụng cao Khoa học máy tính 12 kntt bài 12: Tạo biểu mẫu

4. VẬN DỤNG CAO (2 CÂU)

Câu 1: Kết hợp các phần tử đã học, viết mã HTML hoàn chỉnh cho biểu mẫu đăng ký thi tốt nghiệp gồm họ tên, ngày sinh, giới tính, môn thi và nút gửi.

Câu 2: Đánh giá lợi ích của việc sử dụng thẻ <fieldset> và <legend> trong biểu mẫu lớn có nhiều nhóm thông tin.


Câu 1: 

<form>

   <h1>Đăng ký thi tốt nghiệp</h1>

   <fieldset>

        <legend>Thông tin cá nhân</legend>

        <label for="hoten">Họ và tên:</label>

        <input id="hoten" type="text" name="hoten"><br>

        <label for="ngaysinh">Ngày sinh:</label>

        <input id="ngaysinh" type="date" name="ngaysinh"><br>

        Giới tính:

        <input type="radio" id="nam" name="gioitinh" value="Nam">

        <label for="nam">Nam</label>

        <input type="radio" id="nu" name="gioitinh" value="Nữ">

        <label for="nu">Nữ</label>

   </fieldset>

   <fieldset>

        <legend>Môn thi</legend>

        <label for="toan">Toán:</label>

        <input type="checkbox" id="toan" name="monhoc" value="Toan"><br>

        <label for="van">Văn:</label>

        <input type="checkbox" id="van" name="monhoc" value="Van"><br>

   </fieldset>

   <input type="submit" value="Gửi thông tin">

</form>

Câu 2: 

Thẻ <fieldset> và <legend> giúp biểu mẫu rõ ràng, có cấu trúc nhóm thông tin cụ thể, tạo trải nghiệm người dùng tốt hơn và dễ đọc.


Bình luận

Giải bài tập những môn khác