www.webdeveloper.com
Results 1 to 2 of 2

Thread: Comparisons in JS case sensative things a like - Please help!

  1. #1
    Join Date
    Mar 2012
    Posts
    18

    Comparisons in JS case sensative things a like - Please help!

    Hi what im trying to do is create a if statement that compares words without it being case sensative. how i have it now is -

    the answer is milk
    the user types in Milk
    the output is incorrect.

    the answer is milk
    the user types in milk
    the output is correct

    how i would like to have it -

    the answer is milk
    the user types in milk or Milk
    the output is correct

    code:
    Code:
    if(getValue == getAnswer)
    			{
    				alert("CORRECT");
    			}
    any feedback would be greatly appreciated! thank you!

  2. #2
    Join Date
    Mar 2012
    Posts
    18
    i did some research and found what i was looking for
    Code:
    .toLowerCase()
    Thank you!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles