1. Home
  2. Computing & Technology
  3. JavaScript

HTML to Javascript Converter

Join the Discussion

Questions? Comments?

To ensure that any HTML that you want generated from Javascript document.write statements does not get misinterpreted as Javascript we need to place a slosh (\) in front of certain characters in the text. Each line of HTML source also needs to be separated by \n so that the linefeeds will be correctly inserted into the generated HTML.

If you paste your HTML code into the following form and press the Convert button then the required changes will be made to your code. It even encloses the code into the document.write statement for you.

Explore JavaScript
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. JavaScript

©2009 About.com, a part of The New York Times Company.

All rights reserved.