JavaScript Reference/Javascript Properties/charset

Материал из Web эксперт
Перейти к: навигация, поиск

"charset" Example

   <source lang="javascript">
   

<html> <body> <button onclick="alert(document.charset);">Character Encoding for Document</button> </body> </html>


     </source>
   
  


"charset" is applied to

   <source lang="javascript">

+----------------+--------------------------------------------------------------+ | Applied_To |<a> document | | |<link> | | |<meta> <script> | +----------------+--------------------------------------------------------------+

     </source>
   
  


"charset" Syntax and Note

   <source lang="javascript">

Note: Read and write property. Sets the the element character set.

Syntax:

document.getElementById("elementID").charset = value document.all.elementID.charset = value // IE only


     </source>