If you store the jQuery object in a variable you can do this:
var obj = $("#example").text('this\n has\n newlines');_x000D_
obj.html(obj.html().replace(/\n/g,'<br/>'));
_x000D_
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>_x000D_
<p id="example"></p>
_x000D_
If you prefer, you can also create a function to do this with a simple call, just like jQuery.text() does:
$.fn.multiline = function(text){_x000D_
this.text(text);_x000D_
this.html(this.html().replace(/\n/g,'<br/>'));_x000D_
return this;_x000D_
}_x000D_
_x000D_
// Now you can do this:_x000D_
$("#example").multiline('this\n has\n newlines');
_x000D_
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>_x000D_
<p id="example"></p>
_x000D_