I am trying to select an identifier that changes to different posts on the same page. Thus, they were assigned id = "show_posts_ {PostID}" - at the final output {PostID} is replaced by a number. In the function I need to call $('show_posts_XXXXXX') - XXXXXX - the generated identifier. I saved this identifier in a variable called postId.
But I can not do this $("'" + "show_posts_" + postId + "'")
Can someone tell me how can I add a line to the end of the selector?
jquery string css-selectors
Deshiknaves
source share