我想提醒/提示console.log()
的内容。
如何提醒/提示 - console.log("I want to eat" + " " + food);
?
我试过alert("I want to eat" + " " + food);
,但似乎没有效果。
e.g。
<script>
var foodDemand = function(food) {
console.log("I want to eat" + " " + food);
};
foodDemand("Fried Chicken");
</script>
如何提醒/提示 - console.log("I want to eat" + " " + food);
?
我试过alert("I want to eat" + " " + food);
,但似乎没有效果。
foodDemand("Fried Chicken");
在控制台中产生:
"I want to eat Fried Chicken"
我如何才能与prompt();
或alert();
相同?
答案 0 :(得分:1)
its working for me
<script>
var foodDemand = function(food) {
alert(food);
};
foodDemand("Fried Chicken");
</script>
答案 1 :(得分:0)