document.execCommand & contenteditable

https://developer.mozilla.org/zh-CN/docs/Web/API/Document/execCommand

https://developer.mozilla.org/zh-CN/docs/Web/HTML/Global_attributes/contenteditable

demo

click copy

https://codepen.io/webgeeker/pen/XOJaEP


<blockquote contenteditable="true">
<p>Edit this content to add your own quote</p>
</blockquote> <cite contenteditable="true">-- Write your own name here</cite>
.output {
font: 1rem 'Fira Sans', sans-serif;
} blockquote {
background: #eee;
border-radius: 5px;
margin: 16px 0;
} blockquote p {
padding: 15px;
} cite {
margin: 16px 32px;
} blockquote p::before {
content: '\201C';
} blockquote p::after {
content: '\201D';
} [contenteditable='true'] {
caret-color: red;
}

document.execCommand & contenteditable的更多相关文章

  1. ios9.3.3版本下 document.execCommand("copy") 失败

    copyText()安卓,ios11,ios12都可用 ,并且不弹起输入键盘 // 复制copyText function copyText(text) { var input = document. ...

  2. Javascript中document.execCommand()的用法

    document.execCommand()方法处理Html数据时常用语法格式如下:document.execCommand(sCommand[,交互方式, 动态参数]) 其中:sCommand为指令 ...

  3. document.execCommand 常用的方法

    execCommand方法是执行一个对当前文档,当前选择或者给出范围的命令.处理Html数据时常用如下格式: document.execCommand(sCommand[,交互方式, 动态参数]) , ...

  4. javascript的document.execCommand(转)

    document.execCommand()方法处理html数据时常用语法格式如下: 代码: document.execCommand(sCommand[,交互方式, 动态参数]) 其 中:sComm ...

  5. document.execCommand(”BackgroundImageCache”, false, true)

    很多时候我们要给一些按钮或是img设置背景,而为了达到数据与表现样式分离的效果,通常背景样式都是在CSS里设定的,但是这个行为在IE会有一 个Bug,那就是因为 IE默认情况下不缓存背景图片,所以当鼠 ...

  6. 简易博客编辑器:玩转document.execCommand命令

    xhEditor是基于jQuery开发的跨平台轻量可视化XHTML编辑器,基于LGPL开源协议发布.今天就把它山寨一下. 上几张图,看看效果: 先做出菜单部分:发现是一张背景图片,所以用图片映射的方法 ...

  7. document.execCommand()函数可用参数解析

    隐藏在暗处的方法-execCommand() 关键字: javascript document document.execCommand()方法可用来执行很多我们无法实现的操作. execComman ...

  8. 前端复制功能的若干 -- document.execCommand()

    最近涨停科技公司实习,由于backend基础太弱...强行前端了一把..搞了两周才搞下页面里copy的功能,期间有些琐碎,恐忘,记录在此. 目前copy主流有四种方式:ZeroClipboard,Cl ...

  9. 使用document.execCommand复制内容至剪贴板

    API https://developer.mozilla.org/zh-CN/docs/Web/API/Document/execCommand 兼容性 http://caniuse.com/#se ...

随机推荐

  1. 【NOI2007】社交网络

    [NOI2007]社交网络 Description 在社交网络(social network)的研究中,我们常常使用图论概念去解释一些社会现象.不妨看这样的一个问题.在一个社交圈子里有n个人,人与人之 ...

  2. .net mvc中session的锁机制

    今天遇到个奇怪的问题, 一个秒杀商品系统, 大量秒杀请求进来, 到了action居然是单线程执行! 这样产生的效果就是“这个系统好慢啊!!”. 可是我没有加lock,为什么会变成单线程执行呢? 找资料 ...

  3. Security Permissions Caching

    Security Permissions Caching Security permission caching is implemented in Security Adapters - class ...

  4. WCF 学习笔记一

    wcf服务的细节: 1.新建项目的时候有wcf服务应用程序和wcf服务库,两者区别在于前者可以寄宿在IIS上,而后者只能给其他项目使用,可以寄宿在控制台程序.窗体程序等等. 相关定义的链接 http: ...

  5. 树莓派操控SG90舵机

    目录 舵机接线 PWM介绍 使用PWM控制舵机 这里使用树莓派来操作sg90的舵机.先看一下这个舵机的样子: 这就是传说中的SG90舵机啦,转角是0-180. SG90舵机接线: SG90舵机有三条线 ...

  6. GlusterFS分布式存储集群-2. 使用

    参考文档: Quick Start Guide:http://gluster.readthedocs.io/en/latest/Quick-Start-Guide/Quickstart/ Instal ...

  7. Linux 文件系统 -- 简述几种文件类型

    Linux 中一切皆为文件,文件类型也有多种,使用 ls -l 命令可以查看文件的属性,所显示结果的第一列的第一个字符用来表明该文件的文件类型,如下: 1.普通文件 使用 ls -l 命令后,第一列第 ...

  8. 学习笔记 | Github

    Github教程 \(Github\)是个好东西QwQ 存代码不用U盘爸爸妈妈再也不用担心我的U盘弄丢没有备份啦! 创建github账号 创建仓库 输入命令 git clone https://git ...

  9. 使用FFMPEG 压缩png图片 与tinypng压缩结果对比

    Tinypng  https://tinypng.com/ 一个在线png压缩工具 FFmpeg https://ffmpeg.org/download.html 原图 903 kb Tinypng压 ...

  10. Node of C++ Linker.

    code is nothing without data. data segment - the program memory storing initialized global variable. ...