Home > front end >  High hand! Rookie, don't go into a serious problem?
High hand! Rookie, don't go into a serious problem?

Time:02-09

Experts, help!!! The compiled code editor of this site, how to implement?
Just like writing good code to compile.
url here, can go in and see: https://www.w3school.com.cn/tiy/t.asp? F=js_myfirstjs

CodePudding user response:

The View box can use an iframe, read the contents of the Edit box on the left, then write the View,

CodePudding user response:

reference 1st floor LiuBai_X response:
View box can use an iframe, read the contents of the Edit box on the left, and then write the View,
, the specific code

CodePudding user response:

refer to the second floor kuku_988 response:
Quote: refer to 1st floor LiuBai_X response:
View box can use an iframe, read the contents of the Edit box on the left, and then write the View,
, specific code
how to realize the compilation

CodePudding user response:

Code is not for you last time, how to still ask?
 


<meta charset="utf-8"/& gt;
<meta name="viewport" content="width=device - width, initial - scale=1.0" & gt;
<meta HTTP - equiv="X - UA - Compatible" content="IE=edge, chrome=1"/& gt;
The name of the page & lt;/title> <br/></head> <br/><body> <br/><Input type="button" value="https://bbs.csdn.net/topics/run code" onclick="the run ();"/> <Br/& gt; <br/><Textarea id="text" rows="50" cols="80" & gt; <br/><! DOCTYPE html> <br/><html> <br/><body> <br/><br/><The h2 & gt; My first paragraph JavaScript</h2 & gt; <br/><br/><The button type="button" <br/>Onclick="document. The getElementById (' demo '). InnerHTML=the Date ()" & gt; <br/>Click here to display the date and time <br/></button> <br/><br/><P id="demo" & gt; </p> <br/><br/></body> <br/></html> <br/></textarea> <br/><iframe SRC="https://bbs.csdn.net/topics/about:blank" width="800" height="750" id="ifr" & gt; </iframe> <br/><script type="text/javascript"> <br/>The function the run () {<br/>Var STR=document. GetElementById (" text "). The value; <br/>Var ifr=document. GetElementById (" ifr "); <br/>Ifr. SRC="https://bbs.csdn.net/topics/about:blank"; <br/>Var ifd=ifr. ContentDocument; <br/>Ifd. The open (); <br/>Ifd. Write (STR); <br/>Ifd. Close (); <br/>} <br/>The run (); <br/></script> <br/></body> <br/></html> </pre> <br/> </div> <div class="th_page th_page_color"></div> <div class="umCopyright"> <p>Page link:<a href="/frontend/101386.html" target="_blank" style="color:#999">https//www.codepudding.com/frontend/101386.html</a></p> </div> <div class="detail-arr"> <div class="detail-arr-left">Prev:<a href='/frontend/101385.html'>Springboot packaging error, a great god</a></div> <div class="detail-arr-right">Next:<a href='/frontend/101387.html'>The first sentence is requests on the aspx output XML?</a></div> </div> </div> </div> </div> </div> <div class="container th_top"> <div class="row"> <div class="col-md-12"> <div class="hot-tags neitags"> <ul> <li><i class="iconfont icon-x-tags"></i> Tags:  </li> <a href='/e/tags/?tagname=HTML+%28CSS%29' target='_blank'>HTML (CSS)</a> </ul> </div> </div> </div> </div> <div class="container th_top"> <div class="row"> <div class="col-md-12"> <div class="xiangguan"> <ul class="msg msghead"> <li class="tbname">Related</li> </ul> <ul> </ul> </div> </div> </div> </div> <div class="container th_top"> <div class="row"> <div class="col-md-12"> <div class="flinks"> <ul> <li><i class="iconfont icon-x-tags"></i> Links:  </li> <li class="liflinks"><a target="_blank" href="/" title="CodePudding">CodePudding</a></li> </ul> </div> </div> </div> </div> <div class="footer"> <p><span style="font-size:16px;color:#666;font-weight: bold">About Us:</span>  <a href="https://www.codepudding.com/contact.html">Contact Us</a>      <a href="https://www.codepudding.com/service.html">Terms of Service</a>      <a href="https://www.codepudding.com/privacy.html"> Privacy Policy</a></p> <p class="foot_info">Copyright © 2010-2023,Powered By <a href="/" target="_blank">CodePudding</a> </p> </div> <script type="text/javascript" src="/skin/code/tianhu.js"></script> </body></html>