为什么不变色- - ?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>我们互动下</title>
<style type="text/css">
p{
width:150px;
height:50px;
border:1px solid #333;
padding:5px;
}
</style>
<script type="text/javascript">
var myvalue = document.getElementById("con");
function levelup(){
var mine = confirm("实验阶段");
if (mine=true){
myvalue.style.color="red";
myvalue.style.backgroundColor="pink";
}
else{
document.write("Suprise!");
}
}
</script>
</head>
<body>
<p id="con">js升级篇</p>
<form>
<input type="button" value="点开有惊喜" onclick="levelup()">
</form>
</body>
</html>