- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- 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
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
Advertisements
To Continue Learning Please Login
Login with Google