Access options:

New web site is in beta: A far better experience.

JavaScript syntax highlighter

uploaded: 27th June 2k6

JavaScript is required for the text-parser to work.

A syntax parser for JavaScript code. All occurrences of the symbols: <, >, " and & are replaced with character entities. then the syntax is highlighted. No checks are made for valid code.


Highlight colours are defined by:

<style type="text/css">
span.comment  {color:#060; font-weight:normal}
span.oper     {color:#006; font-weight:normal}
span.var      {color:#600; font-weight:normal}
span.func     {color:#606; font-weight:normal}
span.num      {color:#300; font-weight:bold}
span.string   {color:#066; font-weight:normal}
span.reg      {color:#666; font-weight:normal}


Function addEvent()
The usual onload handler from Simon Willison
Function syntaxHighlight()
A vaguely modified version of Syntax highlighter for JavaScript 1.2 from

Site search & complementary navigation:

Site search:

Online tools

Related tools and articles

Text tools

New to site

Most popular

Inspect report: