让一个div可以编辑加上contenteditable=true 复制来的内容带有样式,需要清除复制的样式
2024-10-16 06:33:03
sEv传keyup进去 function(id,sEv){ id.on(sEv,function(){ var str = $(this).html(); //获取复制进来的内容 var re=/<[^>]+>/g; //清空标签的正则 str=str.replace(re,""); //替换成没有样式的内容 $(this).html(str); //内容替换 }); }
最新文章
- ArcGIS AddIN开发:如何调用ArcMap中的选择工作空间的窗体
- c++之字符型中的特殊字符回车符
- IDA来Patch android的so文件
- java11-1 最常见的类 String类
- HDU 5432 Rikka with Tree (BestCoder Round #53 (div.2))
- setTimeout的作用以及setTimeout延时0毫秒的作用
- WS_EX_TOOLWINDOW 属性的陷阱
- JVM基础(5)-垃圾回收机制
- Asp.Net MVC 捆绑(Bundle)
- C++杂分析
- 02_创建Git仓库,克隆仓库,git add,git commit,git push,git pull,同行冲突,不同行冲突的结局方案,git mergetool的使用
- scala操作HBase2.0
- CentOS 使用yum命令安装出现错误提示”could not retrieve mirrorlist http://mirrorlist.centos.org ***”
- 安卓开发_浅谈Notification(通知栏)
- mysql如何查看数据库的存放位置
- 【cocos2d-js官方文档】事件分发监听机制(摘录)
- Android:使用 DownloadManager 进行版本更新,出现 No Activity found to handle Intent 及解决办法
- log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).
- Eclipse,以及tomcat使用时可能会遇到的几个问题
- 计算机网络——OSI、TCP/IP协议族详解