Created
October 19, 2011 15:42
-
-
Save adrianrodriguez/1298675 to your computer and use it in GitHub Desktop.
Parse integer from parent class name
This file contains hidden or 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
// So I am attempting to target the parent class name of the .next element and store the number. | |
$(function(){ | |
$(".next").parseInt($(this).parent().attr("class")); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
parseInt()
isn't a method you can chain, you have to pass it something (a string usually) to parse.Try the below code:
parseInt($(".next").parent().attr("class"));