标签:ntb value 标题 put cti odi script 按钮 div
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>无标题文档</title>
<style>
div { width:100px; height:100px; border:1px solid #333; }
</style>
</head>
<body>
<div id="div1">123</div>
<input id="btn1" type="button" value="按钮" />
<script>
var oDiv = document.getElementById(‘div1‘);
var oBtn = document.getElementById(‘btn1‘);
oDiv.onclick = function (){
// oDiv.style.width = ‘200px‘;
oDiv.style.cssText = ‘ width:200px; height:200px; ‘;
};
oBtn.onclick = function (){
// oDiv.style.width = ‘100px‘;
oDiv.style.cssText = ‘‘;
};
</script>
</body>
</html>
标签:ntb value 标题 put cti odi script 按钮 div
原文地址:http://www.cnblogs.com/zhousha929-/p/6958319.html