0

I am storing form field values as variables. When I look in the console, toLowerCase() is not recognized.

Any help would be appreciated.

$("#Regbutton").click(function() {
var email = $('#email').val().toLowerCase();
alert(email);
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<form>
<input type="text" id="email"/>
<input type="submit" value="submit" id="Regbutton"/>
</form>
freedomn-m
  • 27,664
  • 8
  • 35
  • 57
  • 2
    What browser are you using? Your snippet works fine in Chrome. – freedomn-m Feb 28 '17 at 20:58
  • Duplicate http://stackoverflow.com/questions/8795752/jquery-usage-of-contains-and-tolowercase – Jules Feb 28 '17 at 20:59
  • @Jules can't see where this question is trying to filter elements based on content – freedomn-m Feb 28 '17 at 21:01
  • OK so those were some pretty bad typos apologies @freedomn-m It may just be that CodePen doesn't like it for whatever reason.. I am using https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js – lr150561 Feb 28 '17 at 21:10
  • Also works ok in jsfiddle with jquery 3.1.1: https://jsfiddle.net/8xjt4bvy/. Have a look at [mcve] and see if you can create a snippet/fiddle that reproduces the error. – freedomn-m Feb 28 '17 at 21:38

0 Answers0