Link to home
Start Free TrialLog in
Avatar of Whing Dela Cruz
Whing Dela CruzFlag for Anguilla

asked on

Select case on click

Hi experts, I want to put "select case" on the script function. What I need is, when the onClick(1) is with 1, then the alert will choose case 1. Thank you! My code are as follows;

onclick="LogIn(1)"


<script>
function LogIn(A)
{
     Select Case A
        case 1
            alert("You can now do log-In");
        case 2
            alert("You can now do log-Out");
}    end select
</script>
ASKER CERTIFIED SOLUTION
Avatar of Jeff Tennessen
Jeff Tennessen
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Whing Dela Cruz

ASKER

Thank you, JTennessen! The code is working.
Glad to help!