JavaScript

  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

Build Your Own Website

Step-by-step advice on how to do everything from choosing a Web host to promoting your content. More >

Connect Your Home Computers

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

JavaScript

  1. Home
  2. Computing & Technology
  3. JavaScript
  4. Script Makers
  5. HTML in Javascript

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

All rights reserved.