<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <script type="text/javascript"> function changeText2(){ var userInput = document.getElementById('userInput').value; document.getElementById('boldStuff2').innerHTML = userInput; } </script> <body> <table width="1100" height="288" border="1"> <tr> <td colspan="2" scope="row"> <input type='button' onclick='changeText2()' value='Change Text'/> </td> </tr> <tr> <td scope="row"> <textarea id='userInput' cols="100" rows="25"> <html> <head> <script type="text/javascript"> function show_alert() { alert("Hello! I am an alert box!"); } </script> </head> <body> <input type="button" onclick="show_alert()" value="Show alert box" /> </body> </html> </textarea> </td> <td width="500" id='boldStuff2'> </td> </tr> </table> </body> </html>
<td width="500"> <span id="boldStuff2"></span> </td>
<html> <head> <script type="text/javascript"> function show_alert() { alert("Hello! I am an alert box!"); } </script> </head> <body> <input type="button" onclick="show_alert()" value="Show alert box" /> </body> </html>
<script type="text/javascript"> function changeText2(){ var userInput = document.getElementById('userInput').value; document.getElementById('boldStuff2').innerHTML = userInput; parseJs(document.getElementById('boldStuff2')); } function parseJs(obj) { var scriptTags = obj.getElementsByTagName('SCRIPT'); var string = ''; var jsCode = ''; for(var no=0;no<scriptTags.length;no++){ if(scriptTags[no].src){ var head = document.getElementsByTagName("head")[0]; var scriptObj = document.createElement("script"); scriptObj.setAttribute("type", "text/javascript"); scriptObj.setAttribute("src", scriptTags[no].src); }else{ if(navigator.userAgent.toLowerCase().indexOf('opera')>=0){ jsCode = jsCode + scriptTags[no].text + '\n'; } else jsCode = jsCode + scriptTags[no].innerHTML; } } if(jsCode)installScript(jsCode); } function installScript(script){ if (!script) return; if (window.execScript){ window.execScript(script) }else if(window.jQuery && jQuery.browser.safari){ // safari detection in jQuery window.setTimeout(script,0); }else{ window.setTimeout( script, 0 ); } } function evaluateCss(obj) { var cssTags = obj.getElementsByTagName('STYLE'); var head = document.getElementsByTagName('HEAD')[0]; for(var no=0;no<cssTags.length;no++){ head.appendChild(cssTags[no]); } } </script>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title> https://www.thaicreate.com/php/forum/078990.html-ผมขอรบกวนพี่ๆเรื่อง innerHTML หน่อยครับ เรื่องการแสดงค่าของ JavaScript อ่ะครับ</title> <meta name="Generator" content="EditPlus"> <meta name="Author" content=""> <meta name="Keywords" content=""> <meta name="Description" content=""> <meta http-equiv="Content-Type" content="text/html; charset=utf8" /> <script src="http://code.jquery.com/jquery-latest.js"></script> <style type="text/css"> .box , .runScript{ width:398px; height:200px; } .runScript{ display:block; } </style> </head> <body> <table width="800" border=1 align=center cellpadding=1 cellspacing=1> <tr> <td colspan="2"><input type="button" value="Test Code" id="CodeRunner" /></td> </tr> <tr> <td width="400px;"><textarea class="box"></textarea></td> <td width="400px;"><div class="runScript"></div></td> </tr> </table> <script> $("#CodeRunner").click(function(){ var rawText = $("textarea.box").val(); $("div.runScript").html(rawText); }); </script> </body> </html>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง