I work within the framework of some very strict package restrictions and for a client who is inexorably in his request, so I have to do something in .js that I would not do.
Anyway, here it goes.
I have customer reviews. At the end of these reviews, I have “United States” or “Australia”. Basically, at the end of each review, I have "- [location]". I need to pull this line from the review text and then insert it into the range. I use jQuery, so I would like to stick with this.
I figured out how to perform each review and paste it where I need it, but I did not understand how to get this line of text from each review, and then remove it from each review. This is where I really could help.
Sample text:
<div class="v2_review-content"> <h4>These earplugs are unbelievable!</h4> <p class="v2_review-text">These are the only earplugs I have ever used that completely block out annoying sounds. I use them at night due to the fact I am an extremely light sleeper and the slightest noise will wake me up. These actually stick to the ear in an airtight suction and do not come out at all until I pull them off in the morning. These are as close to the perfect earplug as you can get! - United States</p> <p class="v2_review-author">Jimmy, March 06, 2013</p> </div>
I also have underscore.js if that helps.
source share