<font face="Verdana"><script><BR>function toScript(val)<BR>{<BR> var value = val.value<BR> value = value.replace(/\\/gi,"\\\\").replace(/"/gi,"\\\"").replace(/'/gi,"\\\'")<BR> valArr = value.split("\r\n")<BR> value=""<br><br> for (i=0; i<valArr.length; i++)<BR> {<BR> value += (i==0) ? "info =" : ""<BR> value += " \"" + valArr[i]<BR> value += (i!=valArr.length-1) ? "\" +\"\\n\"+\n" : "\"\n" <BR> }<BR> value+="\ndocument.write(info)"<br><br> val.value = value<BR>}<BR></script> <br><input type="button" value="将 HTML 转为 JavaScript" onclick='toScript(document.all["code"])'><br><br><textarea id="code" cols="75" rows="20"><br><table width="300"> <br><tr><td align="right">A</td></tr> <br> </table></textarea><br></font>