text/string issue in jquery with html controls -


i have formatted text saved in database.there spaces,bold text,line break etc etc in text.when database , alert it,it ok,all same.but when assign html control

<textarea id="description"></textarea>  

and alert it,it loses html tags space,line breaks bold etc etc...whole text shows 1 paragraph.

  <textarea name="description" cols="200" rows="50" id="description"></textarea>   alert(json.description_demo);//this ok   $("#description").val(json.description_demo);   alert($("#description").val());//now give me issue 

what can issue?here text

brand new!!!

huge size of 3 bedroom apartment located in dubai marina orra tower rent

situated on high floor, overlooking gorgeous view of marina

recreation , sports amenities - temperature controlled swimming pools, jacuzzi, separate wet areas his/hers, state of art gymnasium, tennis & basketball courts , dedicated indoor children play area facilities:

24/7 reception , security swimming pool gym sauna childrens play area luxurious interior design high speed lifts accessible marina mall, emirates mall , ibn batuta mall, 3 minutes

click link dubai marina virtual tour :http://360emirates.com/virtual_tours/15#

rhhh real estate provides full service each , every clientele. offer comprehensive properties sale , rentals. our team highly adept property consultants experts in every aspect of real estate industry.

for further details on property please contact roassasae real estate, orn: 121

tel: +97142

mob: +971544444444 view more properties visit www.abc.ae

to list properties contact , designed marketing package awaits you. rera broker id- 13334

try using contenteditable div :

<div id="description" contenteditable="true">  </div> 

with javascript :

$("#description").html(json.description_demo); 

but careful xss attacks ;).


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -