jQuery Split text() to get new lines -
this question has answer here:
how split .text() , should new lines.
for suppose have this.
var loa = $('.loa_div').text(); alert(loa);
alert loa gives me,
resultabc.resultdefgh.resultkijklm.result12.result888.kkkresult.123result.
i should get
resultabc. resultdefgh. resultkijklm. result12. result888. kkkresult. 123result.
var str= "resultabc.resultdefgh.resultkijklm.result12.result888"; var stresult=str.split('.').join('\n');
demo:
Comments
Post a Comment