How to make html editor and runner using html

Ritesh Html editor

Ritesh Html editor

 

Code

Output

Source code

<html> <head> <title>Ritesh Html editor</title> </head> <body> <table width="100%"border="0"cellspacing="5"cellpadding="5"> <tr> <td width="50%"scope="col">&nbsp;</td> <td width="50%"align="left"scope="col"> <input onclick="run();"type="button"value="Run"> </td> </tr> <tr> <td> <form> <h3>Code</h3> <textarea rows="20" cols="20" name="Code" id="Code"> <html> <head> <title>Ritesh</title> </head> <body> <h1>Hello I am Ritesh!</h1> </body> </html> </textarea> </form> </td> <td> <h4>Output</h4> <iframe height="300" width="200"name="panel" id="panel"></iframe> </td></tr> </table> <script type="text/javascript"> function run(){ var content=document.getElementById('Code').value; var iframe=document.getElementById('panel'); iframe=(iframe.contentWindow)?iframe.contentWindow:(iframe.contentDocument.document)?iframe.contentDocument.document:iframe.contentDocument; iframe.document.open();iframe.document.write(content); iframe.document.close(); return false; } run(); </script> </body> </html>

My website link.

Make more than 20$.

Start freelancing & Earn money

Make upto $10 by only sign uping.

Download my html tutorial

Make $50 for free by sharing ads.

Popular posts from this blog

Download full version pc games for free

How to set background color on a html document