<html> <head> <script type="text/javascript"> function showCharset() { var x=document.getElementById("myForm") alert(x.acceptCharset) } </script> </head> <body> <form id="myForm" acceptCharset="ISO-8859-1"> Text: <input type="text" value="Hello World!"> <input type="button" onclick="showCharset()" value="Show charset"> </form> </body> </html>
编辑上面的文字,按下“查看结果”,效果会显示在右边 Create by 软晨网(RuanChen.com)