doniyor doniyor - 1 year ago 88
jQuery Question

Get text separetly

I have following html


When I try to get text it gives in one line

$('div').text() ---> '123456789'

Question: How to get text separetly like:

123 456 789

Answer Source

For getting text separately, you need to loop through all span and get its text:

$('div span').each(function(){
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download