http://aotianlong.vicp.net/bookdownload.php?url=download/ebooks/htmlref.chm&id=91
解决方案 »
- window.open无法弹出固定位置窗口问题
- 关于Extjs4.0 MVC架构 View
- 多个iframe请求文件下载,为何只弹出一个下载框?
- (高手进)关于jquery 根据窗口变化 改变里面div 的长宽
- 如何实现自动组合功能??
- firefox下,动态添加表格行,并且对单元格赋值,怎么不行?请看下代码
- 如何实现选择多个TD,并且取消选择后要恢复原来的背景图片
- 如何实现网页的全屏显示(在线等 急...)
- 急:用控件播放rm文件只有声音没有图像,请问是怎么回事?
- <textarea name="${topicDet.topicDetId}"
- 如何用JavaScript把一个页面的工具栏,菜单都去了?
- 送分.............
Return ValueReturns a TextRange object if successful, or null otherwise. ResUse a text range to examine and modify the text within an object.ExamplesThis example uses the createTextRange method to create a text range for the document, and then uses the text range to display all the text and HTML tags in the document.<SCRIPT LANGUAGE="JScript">
var rng = document.body.createTextRange( );
if (rng!=null) {
alert(rng.htmlText);
}
</SCRIPT>
This example uses the createTextRange method to create a text range for the first button element in the document, and then uses the text range to change the text in the button.<SCRIPT LANGUAGE="JScript">
var coll = document.all.tags("BUTTON");
if (coll!=null && coll.length>0) {
var rng = coll[0].createTextRange();
rng.text = "Clicked";
}
</SCRIPT>
Standards InformationThere is no public standard that applies to this method.
语法:
oTextRange = object . createTextRange ()
参数:
无
返回值:
oTextRange : 对象(Element)。如果成功的话返回被建立的 TextRange 对象。 说明:
为 object 建立 TextRange 对象。
使用此 TextRange 对象可以检索和修改 object 内的文本。 TextRange 对象的 htmlText 特性尤其提供了方便。
应用于:
IE4.0+ BODYBUTTONINPUT type=buttonINPUT type=hiddenINPUT type=passwordINPUT type=resetINPUT type=submitINPUT type=textTEXTAREA
function rdl_doTextRange(){
var oMessage=document.all("oMessage");
var oTextRange=document.body.createTextRange();
if (oTextRange!=null) alert(oTextRange.htmlText);
}
</script>
<span id=oMessage>我是一些文字。</span>
<br><br>
<input type=button value=" 建立选择区" onclick="rdl_doTextRange();">