Reputation: 1353
All, I am working on populating a div tag with text.
var centName;
centName=centName+$(this).attr('data-centerName');//tried <br/> / '\n'
$("#selOccs").text(centName.Trim(';'));
My div tag is like
<div ID="selOccs" NAME="selOccs" style="width: 350px; height: 100px;border:1px solid ;
overflow-y: scroll; scrollbar-arrow-color: blue; scrollbar-face-color: #e7e7e7; scrollbar-3dlight-color: #a0a0a0; scrollbar-darkshadow-color: #888888">
</div>
The issue is adding line breaks. I need display the centName with line breaks.so far all the values are coming in one line[ as per the code].
I tried adding <--br/--> and '\n' but itseems to be not working..
Upvotes: 0
Views: 11491
Reputation: 1607
var centName;
centName = centName + $(this).attr('data-centerName') + '<br/>';
$("#selOccs").html(centName.Trim(';'));
Upvotes: 2