chronister Posted October 21, 2009 Share Posted October 21, 2009 Hello all.. I suck at javascript and have been messing with this today throughought the last few hours little by little. I have an array or collection of objects or whatever the term is. (they are strings of <p>TEXT HERE</p> tags) I can loop through and get the innerText properly, but I am having trouble taking those and making a string out of each one. I have this so far.... copyText = $(".copy p.copyString"); for(i=0;i < copyText.length; i++){ newString = copyText.innerText; } If I print or alert the newString var, it contains the text I am trying to get to. How would I concatenate these into a string? I have tried join, concat, using the + sign and I want to basically seperate them with a "\n" Thanks for your help. Nate Quote Link to comment Share on other sites More sharing options...
cags Posted October 21, 2009 Share Posted October 21, 2009 newString = newString + copyText.innerText; Should work. 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.