This is my code http://jsfiddle.net/Cfa6c/8/
Basically what I need to do is get the text value of the elements .email_module and put them into an array. So if there was
<span class = "email_module">
example@example.com
</span>
<span class = "email_module">
somebody@somebody.com
</span>
the variables emails would be example@example.com,somebody@somebody.com.
I have tried this code
$('.email_module').map(function () { return $(this).text(); });
but it doesn’t work, could anybody help? Thanks!
You were close using
$.mapbut forgot to convert map result (which is jquery collection) to the array with.get()method:See this updated demo http://jsfiddle.net/Cfa6c/11/