Created
August 19, 2013 18:42
-
-
Save ezos86/6272565 to your computer and use it in GitHub Desktop.
jQuery Variable Error - Object has no method '.val()' or any other method. - it normally results from a Global variable error. Example VS below
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var country = $('.countryCodeAlpha2'); | |
var x = country.val(); | |
console.log(x); | |
VS | |
var country = $('.countryCodeAlpha2').val; | |
console.log(country); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment