`
thinkerAndThinker
  • 浏览: 276281 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

document.execCommand()的用法。

 
阅读更多


<input type=button value=剪切 onclick=document.execCommand('Cut')>
<input type=button value=拷贝 onclick=document.execCommand('Copy')>
<input type=button value=粘贴 onclick=document.execCommand('Paste')>
<input type=button value=撤消 onclick=document.execCommand('Undo')>
<input type=button value=重做 onclick=document.execCommand('Redo') id=button2 name=button2>
<input> www.jbxue.com
<input type=button value=删除 onclick=document.execCommand('Delete')>
<input type=button value=黑体 onclick=document.execCommand('Bold')>
<input type=button value=斜体 onclick=document.execCommand('Italic')>
<input type=button value=下划线 onclick=document.execCommand('Underline')>
<input type=button value=停止 onclick=document.execCommand('stop')>
<input type=button value=保存 onclick=document.execCommand('SaveAs')>
<input type=button value=另存为 onclick=document.execCommand('Saveas',false,'c:\\test.htm')>
<input type=button value=字体 onclick=document.execCommand('FontName',false,fn)>
<input type=button value=字体大小 onclick=document.execCommand('FontSize',false,fs)>
<input type=button value=刷新 onclick=document.execCommand('refresh',false,0)>

 

分享到:
评论

相关推荐

    document.execCommand()的用法

    document.execCommand()的用法

    html中的内容直接下载到excel中,替换 document.execCommand(‘saveAs’)方法

    html中的内容直接下载到excel中的demo,替换 document.execCommand(‘saveAs’)方法

    document.execCommand()的用法小结

    首先要说明的是在firefox下支持不好。2D-Position 允许通过拖曳移动绝对定位的对象。 AbsolutePosition 设定元素的 position 属性为“absolute”(绝对)。 BackColor 设置或获取当前选中区的背景颜色。...

    JavaScript 点击触发复制功能实例详解

     document.execCommand()方法功能很强大,了解更多请戳:https://developer.mozilla.org/zh-CN/docs/Web/API/Document/execCommand 正文: 调用以上方法,就实现了copy功能,可是,在调用之前,你需要先选中需要...

    图库新版jQuery焦点图 JS代码

    tips[27] = '“放之四海皆准则”的是真理,真理并不是一种方法,没有一种方法能解决所有的问题;掌握真理,而不是掌握某种方法。'; tips[28] = '在理解的基础上借鉴,就是站在巨人的肩膀之上;没有区分的全盘抄袭,...

    js实现一键复制功能

    项目描述:最近做一个移动端活动页面,用户抽奖后会生成一个兑换码,为了优化用户体验,需要做一个复制按钮,能够一键复制兑换码。 项目需求: 兼容移动端所有主流浏览器。...格式:document.execCommand(“SelectAll

    JavaScript复制内容到剪贴板的两种常用方法

    原生方法:document.execCommand() 分别来看看这两种方法是如何使用的。 clipboard.js 这是clipboard的官网:https://clipboardjs.com/,看起来就是这么的简单。 引用 直接引用: [removed][removed] 包: npm ...

    js使用小技巧

    document.execCommand 窗体COOKIE document.cookie 菜单事件 document.oncontextmenu 创建元素 document.createElement("SPAN"); 根据鼠标获得元素: document.elementFromPoint(event.x,event.y).tagName...

    IE6背景图片不缓存问题解决方案及图片使用策略多个方法小结

    解决方法一:IE6 Hack脚本 代码如下: [removed] if(navigator.appName == “Microsoft Internet Explorer”){ var b_version=navigator.appVersion;... try { document.execCommand(“BackgroundImageC

    Zero Clipboard js+swf实现的复制功能使用方法

    它利用 Flash 进行复制,所以只要浏览器装有 Flash 就可以运行,而且比 IE 的 document.execCommand(“Copy”) 更加灵活。 Zero Clipboard 的实现原理 Zero Clipboard 利用 Flash 进行复制,之前有 Clipboard Copy ...

    Jquery跨浏览器文本复制插件Zero Clipboard的使用方法

    Zero Clipboard 它利用 Flash 进行复制,所以只要浏览器装有 Flash 就可以运行,而且比IE的document.execCommand(“Copy”) 更加灵活。 Zero Clipboard 的实现原理 Zero Clipboard 利用 Flash 进行复制,之前有 ...

    clipbrd:简单的 Javascript 复制到剪贴板小部件

    它使用“document.execCommand('copy')”函数。浏览器支持Chrome v42 火狐 v41 Internet Explorer v9 歌剧 v29用法 clipbrd . copy ( 'test1234' , // String to be copied into the users' clipboard function ( ...

    JS实现快递单打印功能【推荐】

    3.document.execCommand(”print”) 类似window.print()   **4.采用JQuery插件 5.用浏览器打印第三方插件如lodpod等** 由于我这边不需要兼容ie10以下,而且个人不喜欢在react项目中引入jquery,同时嫌第三方插件...

    ie6下的背景图片缓存

    IE6下CSS背景图片闪烁的Bug(ie6下的背景图片缓存问题) IE6下的背景图片每次使用都会重新发送请求(非本地),连一个hover效果...复制代码代码如下:html {filter:[removed]document.execCommand(“BackgroundImageCac

    text-field-edit:将文字插入和&lt;input&gt;(在可能的情况下支持Firefox和Undo)

    它在Chrome(具有撤消支持)中使用document.execCommand('insertText') ,并在Firefox中复制其行为(在解决之前没有撤消支持)。 如果需要IE支持,请使用 。 安装 您可以下载 或使用npm : npm install text-...

    编译的 HTML 帮助文件 (.chm) DHTML手册

    如果要在 HTC 文件中编码脚本,应使用 element.document 来引用主文档的 document 对象。 示例 下面的例子使用了 document 对象检查文档标题并在消息框中显示该标题(如果非空)。 if (document.title!="") alert(...

Global site tag (gtag.js) - Google Analytics