HTML accept-charset Attribute

HTMLWeb DevelopmentFront End Technology

The accept-charset attribute in HTML is used to set the character encodings for the form.

Following is the syntax−

<form accept-charset="char_set">

Above, char_set is a list of one or more character encodings. This list has space-separated encodings. It can be for Unicode (UTF-8) as well as Latin alphabet (ISO-8859-1).

Let us now see an example to implement the accept-charset attribute−


 Live Demo

<!DOCTYPE html>
<form action="" accept-charset="ISO-8859-1">
   <label for="stinfo">Student:</label>
   <input type="text" id ="stinfo"><br>
   <label for="sub">Subject:</label>
   <input type="text"><br>
   <label for="rank">Rank:</label>
   <input type="number"><br>
   <label for="marks">Marks:</label>
   <input type="number"><br><br>
   <input type="submit">


Updated on 12-Jun-2020 06:23:38