deviant deviant - 4 years ago 141
Javascript Question

Jquery for each in HTML string

I have an HTML string, which I get from using

method. I want to iterate through this whole string, find all divs with class
and push its content to my array. What is the best way to do this?

Answer Source

1st : you need to select the 'div.product-review' by using .find()


2nd: you need to loop through them and push its content to the array

var contentarray = [];
    var ThisIt = $(this);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download