Skip to content

Instantly share code, notes, and snippets.

@adrianrodriguez
Created October 19, 2011 15:42
Show Gist options
  • Save adrianrodriguez/1298675 to your computer and use it in GitHub Desktop.
Save adrianrodriguez/1298675 to your computer and use it in GitHub Desktop.
Parse integer from parent class name
// 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"));
});
@ChrisMBarr
Copy link

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"));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment