查找表单可接受的字符集

  1. <html>
  2. <head>
  3. <script type="text/javascript">
  4. function showCharset()
  5. {
  6. var x=document.getElementById("myForm")
  7. alert(x.acceptCharset)
  8. }
  9. </script>
  10. </head>
  11. <body>
  12.  
  13. <form id="myForm" acceptCharset="ISO-8859-1">
  14. Text: <input type="text" value="Hello World!">
  15. <input type="button" onclick="showCharset()" value="Show charset">
  16. </form>
  17.  
  18. </body>
  19. </html>