-4

ihave problem in jquery when send request to div.

so i have variable like this :-

$text = "hi  ";

so this variable in php i called like this way:-

nl2br($text);

to display in multi line, i need same function to show text like php.

Ganesh Babu
  • 3,590
  • 11
  • 34
  • 67
kamgfx
  • 77
  • 1
  • 1
  • 5
  • 1
    Did you try search functionality of this site? http://stackoverflow.com/questions/2919337/jquery-convert-line-breaks-to-br-nl2br-equivalent – sskoko Oct 05 '13 at 07:02

1 Answers1

-1
$(selector).html(text.replace(/\n/g, '<br>'));
Barmar
  • 741,623
  • 53
  • 500
  • 612