一个简单的程序
<html>为什么弹不出来“hehe”,哪里错了吗? javascript function html
<body>
<script type="text/javascript">
function sum(){
var a=5,b=6;
}
sum();
if(a<b)
{
alert("hehe");
}
else
{
alert("haha");
}
</script>
</body>
</html>
function sum(){
var a=5,b=6;
if(a<b)
{
alert("hehe");
}
else
{
alert("haha");
}
}
sum();