?? computedstyleexample2.htm
字號:
<html>
<head>
<title>Computed Style Example</title>
<style type="text/css">
div.special {
background-color: red;
height: 10px;
width: 10px;
margin: 10px;
}
</style>
<script type="text/javascript">
function getBackgroundColor() {
var oDiv = document.getElementById("div1");
alert(document.defaultView.getComputedStyle(oDiv, null).backgroundColor);
}
</script>
</head>
<body>
<div id="div1" class="special"></div>
<input type="button" value="Get Background Color" onclick="getBackgroundColor()" />
<p><strong>Note:</strong> This example uses the DOM style methods and will fail in Internet Explorer.</p>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -