Retrieve the content from Div's sharing a CSS class [SOLVED]
Hi All,
I have a bunch of <div>'s on a page, each of which shares a CSS class titled "portlet-header".
What I would like to do is retrieve the content inside each of these div's, and then construct a string of each div content separated by a comma.
At the moment I can retrieve the total content from ALL of the div's sharing the "portlet-header" class by using:
-
$(".portlet-header").text()
However, I was hoping that there would be a way of looping through each div of the shared CSS class in turn, constructing a string of the following format:
div content 1,
div content 2,
div content 3 etc...
I had a look at the .each method but couldn't get anything working.
Anyone got any suggestions?
Many thanks in advance
Aj