Get selected text with format using javascript
<p>Basically, I want style of selected text. Suppose, I have a full text "Hello world to sample application" placed in div. Then I made a word "Hello" in bold. I want to retrieve style of word "Hello" word and not of whole div. 
There is one method "getCommandValue" method available but not working with Firefox.
"getComputedStyle" method gives style of the object and not of selected text in div.
Please suggest. It's urgent.
Thanks a lot.</p>
