#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    1
    Rep Power
    0

    Word Specific Criteria


    Hi everyone, I am new to the dev shed forums here. My question is just regarding word specific criteria. I want a certain word to trigger the end result of the program but I am struggling. I am putting the code to a simple program demonstrating the problem below. Any help would be appreciated, Thank You.

    <html>
    <script type="text/javascript">
    var myMajor;
    var msg;
    myMajor = prompt("Enter your major",0);
    if (myMajor = "CI")
    {
    msg = "Not enough points for a prize";
    }
    else
    {
    if (myMajor <= 50)
    {
    msg = "You can choose a prize from group B";
    }
    else
    {
    msg = "You can choose a prize from group A";
    }
    }
    document.write(msg);
    </script>
    </html>
  2. #2
  3. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,316
    Rep Power
    7170
    Single = sign is an assignment operator, double = sign is a comparison operator.
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around

IMN logo majestic logo threadwatch logo seochat tools logo