<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
<script type="text/javascript">
function btn(){
var fruit=ptompt("请问你喜欢什么样的水果")
if (fruit=="苹果")
{document.write("苹果水分含量高")}
else if (fruit=="香蕉")
{document.write("排毒加养颜")}
else
{document.write("要多吃水果哦!")}
}
</script>
</head>
<body>
<input type="button" onclick="btn()" value="按钮"/>
</body>
</html>
prompt不是ptompt