OK, so let's say I have this:
$(function() {
$('#good_evening').keyup(function () {
switch($(this).val()) {
case 'Test':
// DO STUFF HERE
break;
}
});
});
... this would only run if you typed "Test" and not "test" or "TEST". How do I make it case-insensitive for JavaScript functions?
switch($(this).val().toLowerCase()) {
case 'test':
// DO STUFF HERE
break;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With