I am not getting the label text as if modified in textarea..how can i get that?
I am using a textarea and will modify 开发者_运维百科the text like bold,italic,text-color.. now when i click a button i am extracting the text from textarea.now problem is the text is not visible as modified text...the simple text is seen...so what should i do to get the modified text same in label generated...
function createLabel()
{
var text=document.getElementById("heading");
var textVal=text.value;
var label=document.getElementById("LabelShow");
label.innerHTML=textVal;
}
A standard HTML <textarea>
only works with plain text - any formatting you apply to the control is for presentation only and doesn't affect the text returned. If you want to edit rich text in a web page then you need to use a control such as CKEditor.
精彩评论