日期:2014-05-19 浏览次数:20680 次
<html> <head> <title>XXXXXX</title> <script language="javascript"> function test() { var txt = document.getElementById("ta").value; document.getElementById("ta").style.width = Math.ceil(txt.length / 2) * 10; } </script> </head> <body onLoad="test();"> <textarea id="ta" style="overflow:hidden; ">erwtewrtwertertretwetert</textarea> </body> </html>