• Downloading from our site will require you to have a paid membership. Upgrade to a Premium Membership from 10$ a month today!

    Dont forget read our Rules! Also anyone caught Sharing this content will be banned. By using this site you are agreeing to our rules so read them. Saying I did not know is simply not an excuse! You have been warned.

Hỏi Code này sai chỗ nào?

green

New Member
Code:
<script type="text/javascript" language="javascript">
x=prompt("1+1=?","");
if(x=2){alert("giỏi")}esle if(x>2){alert("ngu")}esle if(x<2){alert("ngu")}
</script>
giúp mình với
 
green
Em sửa thành như thế này là được nhé
HTML:
<script language="javascript">
var x = prompt("1+1=?");
x =parseFloat(x);
if (!isNaN(x)) {
if (x > 2) { alert("Ngu");
} else if (x == 2) { 
alert("Gioi"); } else { alert("x < 2"); 
}
}
else { alert("Ngu"); }</script>
 

Facebook Comments

New posts New threads New resources

Back
Top