Javascript examples for DOM HTML Element:Form
Form acceptCharset Property - Change the value of the accept-charset attribute in a form to UTF-8:
<!DOCTYPE html> <html> <body> <form id="myForm" accept-charset="ISO-8859-1"> First name: <input type="text" name="fname" value="Donald"><br> Last name: <input type="text" name="lname" value="Duck"><br> </form>/*from www . j a v a 2 s . com*/ <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() { document.getElementById("myForm").acceptCharset = "UTF-8"; document.getElementById("demo").innerHTML = "The character-set was changed from ISO-8859-1 to UTF8."; } </script> </body> </html>