I'm trying to edit the Original code to get the first p tag from product.description and tried the New Code, but with no success. Is there another method anyone can recommend? Thanks in advance for your help.
Original Code:
if (quickview.find('.des').length > 0) {
var description = product.description.replace(/(<([^>]+)>)/ig, "");
quickview.find('.des').text(description);
}
New Code:
if (quickview.find('.des').length > 0) {
var description = product.description.match(/
(.*?)<\/p>/g, "");
quickview.find('.des').text(description);
}
Example parse for New Code:
First inner content needed.
content...
content...
I'm trying to grab everything inside the first paragraph only and need to remove all p tags and any other tags after.
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)