码迷,mamicode.com
首页 > Web开发 > 详细

DHTML之-----document.selection 的 createRange

时间:2017-01-18 15:11:03      阅读:201      评论:0      收藏:0      [点我收藏+]

标签:control   asp   选择   cti   sel   详细介绍   document   tail   exec   

一、document.selection 介绍

document.selection 表示当前网页中的选中内容。

方法有:

  • clear 清除选中的内容
  • empty 取消选中
  • createRange 返回 TextRange 或 ControlRange 对象
  • createRangeCollection 不支持

属性有:

 

  • type 选中内容的类型
  • typeDetail 不支持

 

二、document.selection.createRange()详细介绍

     document.selection.createRange() 根据当前文字选择返回 TextRange 对象,或根据控件选择返回ControlRange 对象。

配合 execCommand,在 HTML 编辑器中很有用,比如:文字加粗、斜体、复制、粘贴、创建超链接等。

 

DHTML之-----document.selection 的 createRange

标签:control   asp   选择   cti   sel   详细介绍   document   tail   exec   

原文地址:http://www.cnblogs.com/abby-WebDeveloper/p/6296708.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!