Coding Fun Html Highlight.js Tutorial – Highlight Code Syntax in HTML page

Highlight.js Tutorial – Highlight Code Syntax in HTML page





How to use Highlight.js to highlight any code syntax on HTML page. Highlight.js is a syntax highlighter that supports many programming languages such as Javascript, HTML, CSS, Java, C, C++ and more!
Highlight.js:
Example Code:
Fiddle:

Tags: , , , , , , , , , , , , , , , , , ,

7 thoughts on “Highlight.js Tutorial – Highlight Code Syntax in HTML page”

  1. How do yo do it when there are html tags among the php code? All the php code is showing ok, but do not show any html tag. Can you help me with this problem?
    Thank you very much!!
    (Sorry if my english is not the best). 😀

  2. what if i write var test;alert(i+1); inside the <script > tags.It gives undefined error.Overall I have still not understood how to use highlight.js to display syntax of any of the language on browser

  3. Sukesh S says:

    how to highlight java code
    help me
    is the jquery is compulsary for highlighting?

  4. Tyler Angert says:

    could you give a tutorial/quick lesson on how to dynamically change the language of the snippet with a button? for example, if I wanted to change it form java to python with a click. I'm really having trouble with it.

  5. mhmd mhmd says:

    can you please put the jquery file because i have the same proble of Bflatest and i try different jquery but also didn't work

  6. Bflatest says:

    I just get a blank box

Leave a Reply

Your email address will not be published. Required fields are marked *