取消设置按钮不管用
<input type="button" value="改变颜色" onclick="color()">
<input type="button" value="改变宽高" onclick="wh()">
<input type="button" value="隐藏内容" onclick="hide()">
<input type="button" value="显示内容" onclick="show()">
<input type="button" value="取消设置" onclick="exit()">
</form>
<script type="text/javascript">
function color() {
var mycolor = document.getElementById("con")
mycolor.style.color = "blue"
mycolor.style.backgroundColor = "black"
}
function wh() {
var myweight = document.getElementById("txt")
myweight.style.width = "100px"
myweight.style.height = "600px"
}
function hide() {
var hide = document.getElementById("txt")
hide.style.display = "none"
}
function show() {
var show = document.getElementById("txt")
show.style.display = "block"
}
function exit() {
var quxiao = confirm("你要取消设置吗")
if(quxiao == true)
{
mycolor.removeAttribute("style")
myweight.removeAttribute("style")
hide.removeAttribute("style")
show.removeAttribute("style")