选择其中部分字符,然后点击BUTTON查看效果 <html><head><style type="text/css"></style><META http-equiv="content-type" content="text/html; charset=shift_jis"><title>TEST</title></head><LINK rel="stylesheet" href="../css/table.css" type="text/css" id="_HPB_TABLE_CSS_ID_"><script type="text/javascript"> function FantinySel()...{ var oV = 0; var nV = 0; var rng = document.getElementById("textAr").createTextRange(); var r1 = document.selection.createRange(); var r2 ; oV = r1.boundingHeight; nV = r1.boundingHeight; if (r1.parentElement().name == "textAr")...{ while(oV == nV)...{ r2 = r1.duplicate(); r2.moveEnd("character",1); nV = r2.boundingHeight; if (oV == nV)...{ r1.moveEnd("character",1); } } r1.select(); } oV = r1.boundingHeight; nV = r1.boundingHeight; if (r1.parentElement().name == "textAr")...{ while(oV == nV)...{ r2 = r1.duplicate(); r2.moveStart("character",-1); nV = r2.boundingHeight; if (oV == nV)...{ r1.moveStart("character",-1); } } r1.select(); } }</script></head><body bgcolor= "#ffffff"><form method="post" action="" name="FMlog"> <table> <tr><td> <input type = button value = "Config" onclick = "FantinySel()"> </td></tr> <tr><td> <textarea name = "textAr" rows = "5" cols = "100">1234243234235678234242398762342423987652342342356782342423987623424239876523423423 </textarea> </td> </tr></table></form></body></html>