• 首页
  • 博客
  • 下载
  • AI
    • 科技
    • 互联网
  • 会员中心
    • 会员中心
    • 发布资讯
    • 发布博文
    • 发布资源
  1. 首页
  2. 文章中心
  3. Web前端

按格式回显

登录 注册新账号
舒服小熊猫
文章
4
资源
0
加入时间
3年前

热门文章

1
使用JS获取SessionStorage的值
2
易语言调用GetUserPassWord.dll获取系统开机密码
3
css怎么删除滚动条
4
按格式回显'); $(this).removeAttr("style",""); // $(this).wrap('
'); }); $('.main-content .codebody').each(function(){ var code = $(this).text(); $(this).wrap('
'); $(this).before('复制代码'); // $(this).wrap('
'); }); function unescapeSpecialChars(str) { return str .replace(/</g, '<') .replace(/>/g, '>') .replace(/&/g, '&') .replace(/ /g, ' ') .replace(/"/g, '"') .replace(/'/g, '\''); } //复制代码 $('.copyCode').on('click',function(){ var txt = $(this).next().html(); txt = unescapeSpecialChars(txt); new ClipboardJS('.copyCode', {text: function() {return txt;}}); layer.msg('复制成功',{time:1000,offset:'100px'}); });