<!DOCTYPE html>
<html>
<head>
<title>DOM Form accept-charset Property
</title>
<style>
h1 {
color: green;
}
body {
text-align: center;
}
</style>
</head>
<body>
<h1>GeeksforGeeks</h1>
<h2>DOM Form accept-charset Property
</h2>
<form action="#"
accept-charset="UTF-8"
id="users">
First name:
<input type="text"
name="fname">
<br> Last name:
<input type="text"
name="lname">
<br>
<input type="submit"
value="Submit">
</form>
<p><b>Click on "Try it" Button to set the
value of the accrpt-charset attribute.
</b></p>
<button onclick="myGeeks()">
Try it
</button>
<p id="sudo"
style="font-size:25px;color:green;">
</p>
<script>
function myGeeks() {
// Set acceptCharset property.
var x = document.getElementById(
"users").acceptCharset = "ISO-8859-1";
document.getElementById("sudo").innerHTML =
"The value of the accept-charset attribute"
" was changed to " + "<br>" + x;
}
</script>
</body>
</html>