运行 ❯
获取您
自己的
网站
×
更改方向
保存代码
更改主题,深色/浅色
转到 Spaces
<!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> <p>Click the button to change the value of the accept-charset attribute in the form element.</p> <button onclick="myFunction()">Try it</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>