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
just use $("#show_posts_"+postID)
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.
Should work. If it does, you'll kick yourself. Don't forget the hash for the ID, and the extra quotation marks aren't necessary.
$("#show_posts_" + postId)
Two things.
To select an element with a given
ID, you need a #
character at the
beginning of the ID.
Don't add the quotes to the beginning and end of the string.
Thus:
$('#show_posts_' + postId)