Free HTML to Javascript Converter
Use this free HTML to Javascript converter to convert your HTML code (or plain text) into Javascript document.write() statements. Enter your HTML into the box below click "Convert Now" and it will be converted to Javascript code that outputs that same HTML or text. Quote and backslash characters will be appropriately escaped with backslashes so the strings will print correctly.
Suppose you're writing an HTML page about Javascript. You have examples you want to refer to. So, paste the code into the top big box . You will be shown what the HTML table version of your code looks like. Right below that is a block of HTML you can copy. Paste it into your HTML document and you'll have a neatly displayed table, with numbers for all the lines that are non-blank. Plus, it creates be a button that lets your readers show or hide the numbers so that they can more easily copy the code you're displaying