Forum : use of and operator in switch
Brief description  about Online courses   join in Online courses
View Aditi  Gupta 's Profile

use of and operator in switch

Kindly please check the error:
function message()
{
var g= document.form1.sgrade.value;

switch(g)
{
case "g>90
Asked by Aditi Gupta | Jan 6, 2010 |  Reply now
Replies (3)
View sanjay s nair 's Profile
<html>
<head>
<title>Switch Statment</title>
<script language=javascript>
function getPage(p){
switch(p){
case 'google':window.location='http://www.google.com';
break;
case 'yahoo':window.location='http://www.yahoo.com';
break;
case 'microsoft':window.location='http://www.microsoft.com';
break;
default:break;
}
}
</script>
</head>
<body>
<a href=# onClick="getPage('google')" >Goto Google.com</a><br>
<a href=# onClick="getPage('yahoo')" >Goto Yahoo.com</a><br>
<a href=# onClick="getPage('microsoft')" >Goto Microsoft.com</a>
</body>
</html>
Jan 8, 2010
View aditi gupta 's Profile
hello sanjay ! I checked that link which you give to me but still have problem could you plz give an eg of switch with and condition.
Jan 7, 2010
View sanjay s nair 's Profile
I think you are using switch wrong way. Please read the following link.
http://php.net/manual/en/control-structures.switch.php
Jan 6, 2010