simple & fast javascript syntax highlighting for the browser
Latest commit 0eaa003 Apr 12, 2011 @fat fat committed with Alexis Sellier fix command line check to allow for jquery-like snippets
Failed to load latest commit information.
LICENSE initial commit Jun 12, 2010 (doc) README update Jul 25, 2010
hijs.js fix command line check to allow for jquery-like snippets Apr 14, 2011


hijs is a dead-simple syntax highlighter for JavaScript code on the browser.

By default, it highlights everything inside <code> blocks.

If you have command-line snippets, such as:

$ ls -l > /dev/null

it will skip those, cause they ain't no JavaScript.


Put this at the end of your <body>:

<script src="hijs.js"></script>

If you would like to specify what gets highlighted, set the global hijs variable before you include the script:

window.hijs = '.highlight';


Code extract from http-console, highlighted by hijs:



hijs is a simple solution to a potentially complicated problem. It won't fit all your needs, but if what you're trying to achieve is simple enough, hijs might be the tool for you.


hijs wraps tokens in <span> tags. You can style them like so:

code .keyword              { font-weight: bold }
code .string, code .regexp { color: green }
code .class, code .special { color: blue }
code .number               { color: pink }
code .comment              { color: grey }

more info