标签:
一、使内容水平出现
<html> <head> <title>测试</title> <script type="text/javascript"> function to() { var txt=document.getElementById("txt").value; document.getElementById("a").innerHTML+=txt; } </script> </head> <body> <div id="a">在这里显示:</div> <button onclick="to();">输入</button> </body> </html>
<html> <head> <title>测试</title> <script type="text/javascript"> function to() { var txt=document.getElementById("txt").value; var row=document.getElementById("ib").insertRow(); row.align="center"; var tt0=row.insertCell(); tt0.innerHTML=txt; } </script> </head> <body> <div id="a"></div> <table id="ib"> <tr> <th>content</th> </tr> </table> <input type="text" id="txt" value="" size="30"> <button onclick="to();">输入</button> </body> </html>
标签:
原文地址:http://www.cnblogs.com/linzb1993/p/4590704.html