用js解决数字不能换行问题

时间:2024-04-23 09:25:38 


function toBreakWord(intLen, id){
var obj=document.getElementById(id);
var strContent=obj.innerHTML;
var strTemp="";
while(strContent.length>intLen){
strTemp+=strContent.substr(0,intLen)+"<br>";
strContent=strContent.substr(intLen,strContent.length); }
strTemp+= strContent;obj.innerHTML=strTemp;
}


.br{word-break:break-all;word-warp:break-word;background-color:#eee;}

标签:数字,不能换行
0
投稿

猜你喜欢

  • div中class与id的区别及应用

    2007-09-22 08:37:00
  • win7安装python生成随机数代码分享

    2021-05-18 10:47:39
  • 教你使用一行Python代码玩遍童年的小游戏

    2021-05-15 10:14:00
  • MySQL Community Server 8.0.29安装配置方法图文教程

    2024-01-22 12:02:55
  • 基于python的selenium两种文件上传操作实现详解

    2022-01-31 23:02:17
  • 不同情况下修复Access数据库的实用方法

    2008-11-28 16:18:00
  • Django密码系统实现过程详解

    2022-10-13 15:55:33
  • python输出结果刷新及进度条的实现操作

    2022-09-24 15:13:15
  • pycharm console 打印中文为乱码问题及解决

    2023-06-15 22:30:02
  • python_mask_array的用法

    2022-05-10 06:25:27
  • 关于python实现requests接口测试的问题

    2023-08-27 10:09:18
  • Python字符串的索引与切片

    2021-08-17 23:46:00
  • python pandas时序处理相关功能详解

    2023-07-25 12:03:18
  • 下拉列表两级连动的新方法(二)

    2009-06-04 18:22:00
  • css中如何使div居中(垂直水平居中)

    2007-08-13 08:17:00
  • javascript json字符串到json对象转义问题

    2023-07-02 05:18:22
  • 显示日期格式的几个函数

    2008-09-03 13:20:00
  • Python 文件操作的详解及实例

    2021-06-05 12:59:12
  • Python离线安装openpyxl模块的步骤

    2021-08-10 16:04:04
  • python 将字符串转换成字典dict的各种方式总结

    2022-06-28 21:13:35
  • asp之家 网络编程 m.aspxhome.com