

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
HTML <script> charset Attribute
The charset attribute of the <script> element is used to set character encoding, which is used in an external script file.
Following is the syntax−
<script charset="charset">
Above, set charset, which is the character encoding to be used in an external script file. With “UTF-8”, you can set the character encoding for Unicode. Let us now see an example to implement the charset attribute of the <script> element−
Example
<!DOCTYPE html> <html> <body> <script charset="UTF-8" src="new.js"></script> <p>Displaying the characters with "UTF-8" character set.</p> <p>.</p> </body> </html>
Above, we have used a script file “new.js”, which displays the symbols.
Output
- Related Questions & Answers
- HTML charset Attribute
- HTML accept-charset Attribute
- HTML <meta> charset Attribute
- HTML Charset
- HTML DOM Script Object
- HTML accept Attribute
- HTML accesskey Attribute
- HTML autofocus Attribute
- HTML checked Attribute
- HTML Class Attribute
- HTML cols Attribute
- HTML colspan Attribute
- HTML content Attribute
- HTML contenteditable Attribute
- HTML data Attribute
Advertisements