title: Javascript how to get selected text with its font family
body: <p>I am saving selected text and its range from paragraph so i can later display it selected when open html again. I have completed all task like save its range and apply again when open it again.
  So i am also saving the string which is selected from the paragraph and display it in a list so i can delete also, and for that i am using function like :-></p>
  
  <pre><code>var selection = window.getSelection();
  var textString = selection.toString(); 
  </code></pre>
  
  <p>As of now it was working fine. But now i have added a multiple language in my editor. So if i save string like above the font family which is applied to selected text, its not getting display.</p>
  
  <p>So i want save its font style also, so when i show selected text in list, it will render as its font style.</p>
  
  <p>How can i get font family which is applied currently on selected dom. And if not font family applied on selected dom it will come from its parent.</p>
  
  <p>I dont need other styles like, color , font-weight etc. </p>
  
  <p>Suppose:</p>
  
  <pre><code>&lt;span style="font-family: "Times New Roman", Times, serif;&gt;This is&lt;span style="font-family:Conv_DevLys_040"&gt;Test content.&lt;/span&gt;&lt;span&gt;
  </code></pre>
  
  <p>If i select "text content" then need to apply Conv_DevLys_040 font family, if select all text then need to apply both style on particular spans.</p>