js如何获取文本行数

高度/行高=文本行数

<script>

    // 高度/行高=文本行数
    var rowNum=Math.round($(".txt").height()/parseFloat($(".txt").css('line-height')));
    alert("当前有"+rowNum+"行");
</script>
原文地址:https://www.cnblogs.com/kunmomo/p/12697251.html