本文實(shí)例講述了JavaScript使表單中的內(nèi)容顯示在屏幕上的方法。分享給大家供大家參考。具體實(shí)現(xiàn)方法如下:
一、使內(nèi)容水平出現(xiàn)
?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 <html> <head> <title>測(cè)試</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>二、使內(nèi)容以表格形式出現(xiàn)
?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 <html> <head> <tit希望本文所述對(duì)大家的javascript程序設(shè)計(jì)有所幫助。
新聞熱點(diǎn)
疑難解答
圖片精選
網(wǎng)友關(guān)注