I am using Text area tag in html and i have to print the ingredients in separate lines but even on using enter key it is coming in a single line when i pass the value of text area to a variable and print it.
Following is my code snippet :
<div data-role="fieldcontain">
<label for="name">Ingredients</label>
<textarea rows="4" cols="50" id="new_ingredients">
</textarea>
</div>
$( '#new_recipe' ).live( 'pagebeforeshow',function(event){
var temp1 = $("#new_ingredients").val();
$("#testing").text(temp1);
});
<div data-role="page" id="new_recipe">
<div class="content" id="testing" ></div>
</div>
Please help me as to how could i get data in different lines when the user presses enter key.Thank you in advance.