shortysbest Posted July 14, 2010 Share Posted July 14, 2010 I have a comment system, with multiple posts on a page, i want people to be able to comment on the post they want, I need to get the id of the correct texta area, and button. I can get it how i want, except When im using a variable: $j(".status-button").click(function() { var element = $j(this); var I = element.attr("id"); var boxval = $j('#profile-comment4').val(); alert(boxval); when i have #profile-comment4 it gets it, however when i put $j(".status-button").click(function() { var element = $j(this); var I = element.attr("id"); var boxval = $j('#profile-comment'+I).val(); alert(boxval); it comes back as undefind. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.