In javascript, what is the best way to parse an INT from a string which starts with a letter (such as \"test[123]\")? I need something that will work for the example below.
You could use a regular expression to match the number:
$(this).attr("id").match(/\d+/)