?? 12-5 “execcommand”方法應用示例.htm
字號:
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=GB2312" />
<title>12-5 “execCommand”方法應用示例</title>
<style>
* { font-size:12px; font-family:宋體, Arial; } /*規定了所有的字體樣式*/
body { overflow:auto; background-color:buttonface; border-style:none; }
a { margin:2px 10px; color:white; font-weight:bold; }
#d01 { font-size:14px; color:white; font-family:Arial, 宋體; background-color:#6090DA; padding:4px 10px; height:24px; }
</style>
<script>
function insertLink(){
var newLink = document.createElement("a");
newLink.innerHTML = $("txtDesc").value;
newLink.href = $("txtAddr").value;
$("d01").appendChild(newLink);
}
function $(str){ return(document.getElementById(str)); }
</script>
</head>
<body>
<table>
<tr>
<td>鏈接地址:</td><td><input id="txtAddr"></td>
</tr><tr>
<td>鏈接描述:</td><td><input id="txtDesc"></td>
</tr><tr>
<td cols="2"><input type="button" value="添加" onclick="insertLink();"></td>
</tr>
</table>
<div id="d01" ></div>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -