Run the HTML code online:
<!DOCTYPE HTML><HTML><Head> <MetaCharSet= "Utf-8"> <title>Running the HTML code on line (i)</title> <Script>window.onload= function(){ varBtrun=document.getElementById ("Btrun"); varCdarea=document.getElementById ("Cdarea"); Btrun.onclick= function(){ if(Cdarea.value!= "stick the HTML code here and click Run. "){ varNewwin=window.open ("', "_blank", "'); Newwin.document.open ('text/html', 'Replace'); Newwin.opener= NULL; Newwin.document.write (Cdarea.value); Newwin.document.close (); } Else{alert ("please fill in the required HTML into the input box and then run! "); } } } functioncodeclear () {document.getElementById ('Cdarea'). Value= ""; document.getElementById ('Cdarea'). focus (); } </Script></Head><Body> <textareaID= "Cdarea"style= "background: #f9f9f9; color: #b4b4b4;"rows= "8"cols= "Max"onfocus= "if (this.value== ') stick the HTML code here, click to run. ') {this.value= '; this.style.color= ' #000000 '; this.style.fontfamily= ' Courier New '; this.style.fontsize= ' 14px '} " onblur= "if (this.value== ') {this.value= ') stick the HTML code here, click to run. ‘; This.style.color= ' #ACA899 ';} ">Stick the HTML code here and click Run.</textarea> <BR/> <inputID= "Btclear"type= "button"value= "Clear"onclick= "codeclear ();" /> <inputID= "Btrun"type= "button"value= "Run" /></Body></HTML>
Effect: Run the HTML code device online
stick the HTML code here and click Run.
Running the HTML code on line (i)