Thuộc tính accept-charset trong HTML được dùng để đặt mã hóa ký tự (character encodings) cho form (biểu mẫu).
Cú pháp:
<form accept-charset="char_set">
Ở trên, char_set là danh sách một hoặc nhiều mã hóa ký tự. Danh sách này có các mã hóa cách nhau bởi dấu cách. Có thể dùng cho Unicode (UTF-8) cũng như bảng chữ cái Latin (ISO-8859-1).
Ví dụ
<!DOCTYPE html> <html> <body> <h2>Kết quả</h2> <form action="" accept-charset="ISO-8859-1"> <label for="stinfo">Học sinh:</label> <input type="text" id ="stinfo"><br> <label for="sub">Môn học:</label> <input type="text"><br> <label for="rank">Xếp hạng:</label> <input type="number"><br> <label for="marks">Điểm:</label> <input type="number"><br><br> <input type="submit"> </form> </body> </html>
Kết quả
