I need to get a list of comma-separated values from jQuery ajax data returned from the server. The data I am getting is as below
<div id="1" class="clicked">A</div>
<div></div>
<div id="2" class="clicked">B</div>
<div></div>
<div id="3" class="clicked">dsf</div>
<div></div>
<div id="4" class="clicked">fd</div>
<div class=users>pp@gmail.com,pp1@gmail.com</div>
This is the data that I get when the alert it. I need to extract the div with class = users and update it to another div as lists. How is it possible.. Please help
Something like this works. We use
$to cast the string into a jQuery object. Then you can use normal jQuery calls like filter to get the list of emails.Then create a list. Then append each email to it.
http://jsfiddle.net/BCmqL/3