<a id="more">查看全部</a> </div> JS实现代码: <script type="text/javascript"> var end; var oDiv = document.getElementById("geGameResultAll"); var oText = oDiv.innerHTML; function suolve(str) { var sub_length = 500; var str_length = str.length; var res = str.substring(0, sub_length - 5); if (sub_length < str_length) { end = res + "……"; } else { end = res; document.getElementById("more").style.display = "none"; } return end; };