How to loop through my results and format each number string. The first result is formated correctly, but not the second result or any result after the first.
$('#phoneResults').each(function(){
//Only the first result is being altered! Ugh.
var string = $(this).html();
$(this).html(string.substring(0,3) + '.' + string.substring(3,6) + '.' + string.substring(6,10))
});
Likely because the
#refers to an element ID, which by convention is unique. jQuery will treat this as a single item, so iteration will yield only a single result.Maybe try something like: