
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
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
Create Syntax Highlighting Code with JavaScript
To create a syntax-highlighting code with JavaScript, use the prettify library. Add the following in your code to add the library for syntax highlighting −
<script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js"></script>
To use it, add the following to your <pre> tag −
<pre class="prettyprint"> Code comes here </pre>
Advertisements