Create a syntax highlighting code with JavaScript.

JavascriptObject Oriented ProgrammingFront End Technology

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=""></script>

To use it, add the following to your <pre> tag −

<pre class="prettyprint">
   Code comes here
Updated on 23-Jun-2020 12:00:35