I am using the textarea for my web page.
It is similar to RichTextEditor.
Now i want to get the code for that text entered with its style and value of the text using JavaScript… so please can anyone help me.
I am able to extract only value but not style of the text..so how can I get the style also with text value…
Style all by itself won’t tell you what you want. You need to ask for a child of ‘style’. Something like:
var textarea_style = getRefToDiv( ‘id_of_the_textarea’ ).style.the_style_attribute_you_want;
For example, style.fontWeight, style.lineHeight, and so on. BTW, the styles you set with CSS:
font-weight: bold;
in JS are named by deleting the dash and capitalizing the word after it, so in JS it’s fontWeight.