I\'m trying to select an id that changes on different posts of same page. So the they have been given an id=\"show_posts_{PostID}\" - on the final output the {PostID} is re
You need to include the '#' character at the start of the string.
$('#show_posts_' + postId)
Also, you're trying to stuff the quotes in there in your example, and that doesn't make sense.