ga-wdi-exercises / project1

[project] GA- Project 1
3 stars 75 forks source link

input value uppercase/lowercase #201

Closed alifrumin closed 9 years ago

alifrumin commented 9 years ago

I made a quiz and it works but you have to enter the answer exactly I have it... (all lowercase)... I know you can set it up to text transform the input value to uppercase and then test against uppercase so that if per say the user entered the answer in camelcase it would still work... is there an easier way in jquery?

Hope you are having a good day so far!

RobertAKARobin commented 9 years ago

Hm. You know, I'm not sure whether text-transform actually makes it lowercase, or just makes it look lowercase. My guess would be the latter.

Fortunately, Javascript has a toLowercase method!

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLowerCase

alifrumin commented 9 years ago

awesome Thank you!