HTML charset attribute: This attribute mainly used for character encoding of an element if it was used by <meta> element. While it is also used in the external script if it was used by the <script> element.
HTML charset attribute
This attribute is having elements like <meta> & <script>.
Charset attributes in <meta>
The charset attribute is present in the meta element. It defines the character encoding for the HTML document.
This attribute supports different types of browsers. They are as follows:
- Google Chrome
- Internet Explorer
Example: external script of java
<script src="myscripts.js" charset="UTF-8"></script>
Greek symbols: αβγδεζηθ
The Greek characters display correctly because they are part of the “UTF-8” character set.
Try changing character sets to “ISO-8859-1” (default), “windows-1252” or “UTF-16”.
Example: Character encoding of element
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> </head> <body> <h1>Freshersnow</h1> <p>Place for all programming tutorials...</p> </body> </html>