HTML to Javascript

53lu > HTML to Javascript

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.

How it Works?

Just paste your HTML code to the textarea above and click to the button "HTML to JS" and you will get Javascript statements or variable in the next textarea.

Example of HTML conversion to JS

Before:

<html>
	<head>
	<title>Your Title Here</title>
	</head>

	<body bgcolor="FFFFFF">
		<center><img src="53lu.jpg" align="bottom"> </center>
		<hr>
		<a href="https://www.53lu.com">Best Online Web Tools</a>is a link to another nifty site
		<h1>This is a Header</h1>
		<h2>This is a Medium Header</h2>
		<p> This is a new paragraph!</p>
		<p> <b>This is a new paragraph!</b></p>
		<br> <b><i>This is a new sentence without a paragraph break, in bold italics.</i></b>
		<hr>
	</body>
</html>

After:

document.writeln('<html>');
document.writeln('    <head>');
document.writeln('    <title>Your Title Here</title>');
document.writeln('    </head>');
document.writeln('');
document.writeln('    <body bgcolor="FFFFFF">');
document.writeln('        <center><img src="53lu.jpg" align="bottom"> </center>');
document.writeln('        <hr>');
document.writeln('        <a href="https://www.53lu.com">Best Online Web Tools</a>is a link to another nifty site');
document.writeln('        <h1>This is a Header</h1>');
document.writeln('        <h2>This is a Medium Header</h2>');
document.writeln('        <p> This is a new paragraph!</p>');
document.writeln('        <p> <b>This is a new paragraph!</b></p>');
document.writeln('        <br> <b><i>This is a new sentence without a paragraph break, in bold italics.</i></b>');
document.writeln('        <hr>');
document.writeln('    </body>');
document.writeln('</html>');

Copyright © 2021-2024 53lu