reset函数运行不了,是什么鬼?????
reset函数运行不了,是什么鬼?????
reset函数运行不了,是什么鬼?????
2018-10-26
<input type="button" onclick="changecolor()" value="改变颜色" >
<input type="button" onclick="changewidth()" value="改变宽高" >
<input type="button" onclick="content()" value="隐藏内容" >
<input type="button" onclick="display()" value="显示内容" >
<input type="button" onclick="reset()" value="取消设置" >
</form>
<script type="text/javascript">
var text=document.getElementById('con');
var box=document.getElementById('txt');
function changecolor(){
text.style.color='red';
box.style.backgroundColor='gray';
}
function changewidth(){
var box=document.getElementById('txt');
box.style.width='200px';
box.style.height='500px';
}
function content(){
box.style.display="none";
}
function display(){
box.style.display="block";
}
function reset(){
var srs = confirm("确认取消设置?");
if (srs==true)
{
box.style.color = "black";
box.style.backgroundColor = "white";
box.style.width = orignWidth;
box.style.height = orignHeight;
box.style.display = "block";
}
}
</script>
</body>
</html>
举报