<html>
<head>
<title>iRock</title>
<script type="text/javascript">
function touchrock(){
var userName=prompt("what is your name?","enter your name here.");
if(userName){
alert("it is good to meet you,"+username+".");
document.getElementById("rockImg").src="smile.png"
}
}
</script>
</head>
<body onload="alert('*Helloo,I am your pet rock.*');">
<div style="margin-top:100px;text-align:center">
<img id="rockImg" src="rock.png" alt="iRock" style="cursor:pointer" onclick="touchrock();"/>
</div>
</body>
</html>
<head>
<title>iRock</title>
<script type="text/javascript">
function touchrock(){
var userName=prompt("what is your name?","enter your name here.");
if(userName){
alert("it is good to meet you,"+username+".");
document.getElementById("rockImg").src="smile.png"
}
}
</script>
</head>
<body onload="alert('*Helloo,I am your pet rock.*');">
<div style="margin-top:100px;text-align:center">
<img id="rockImg" src="rock.png" alt="iRock" style="cursor:pointer" onclick="touchrock();"/>
</div>
</body>
</html>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货