<html> <head> <title>ThaiCreate.Com Ajax Tutorial</title> <script language="JavaScript"> function fnc_innerHTML() { var myTime = new Date(); document.getElementById("mySpan1").innerHTML = myTime; var myTable = "<table width=\"190\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\">" + "<tr>"+ "<td>ThaiCreate.Com</td>"+ "<td>ThaiCreate.Com</td>"+ "</tr>"+ "<tr>"+ "<td>ThaiCreate.Com</td>"+ "<td>ThaiCreate.Com</td>"+ "</tr>"+ "</table>"; document.getElementById("mySpan2").innerHTML = myTable; } function fnc_innerText() { document.getElementById("mySpan3").innerHTML = "<hr>"; var myTime = new Date(); document.getElementById("mySpan4").innerText = myTime; var myTable = "<table width=\"191\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\">" + "<tr>"+ "<td>ThaiCreate.Com</td>"+ "<td>ThaiCreate.Com</td>"+ "</tr>"+ "<tr>"+ "<td>ThaiCreate.Com</td>"+ "<td>ThaiCreate.Com</td>"+ "</tr>"+ "</table>"; document.getElementById("mySpan5").innerText = myTable; } </script> </head> <body> <span id="mySpan1"></span> <span id="mySpan2"></span> <span id="mySpan3"></span> <span id="mySpan4"></span> <span id="mySpan5"></span> <br><br> <input name="btnButton" id="btnButton" type="button" value="Click" onClick="JavaScript:fnc_innerHTML();fnc_innerText();"> </body> </html>
ช่วยกันสนับสนุนรักษาเว็บไซต์ความรู้แห่งนี้ไว้ด้วยการสนับสนุน Source Code 2.0 ของทีมงานไทยครีเอท