?? ierangeexample4.htm
字號(hào):
<html>
<head>
<title>IE Range Example</title>
<script type="text/javascript">
//This example shows what happens when you try to use
//pasteHTML() while HTML code is selected.
function useRanges() {
var oRange = document.body.createTextRange();
var oP1 = document.getElementById("p1");
oRange.moveToElementText(oP1);
oRange.pasteHTML("<p><em>Howdy</em> World</p>");
alert(document.body.innerHTML);
}
</script>
</head>
<body><p id="p1"><b>Hello</b> World</p>
<input type="button" value="Use Ranges" onclick="useRanges()" />
<p><strong>Note:</strong> This example uses Internet Explorer ranges and will only work on Internet Explorer.</p>
</body>
</html>
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -