title: Getting all css used in html file
body: <p>I have to get what are all the CSS styles used in a HTML file using JavaScript.</p>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;
          &lt;style type="text/css"&gt;
              body {
                  border: 1px solid silver;
              }
              .mydiv{
                  color: blue;
              }
          &lt;/style&gt;
      &lt;/head&gt;
      &lt;body&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>If the above code is my HTML I have to write one JavaScript function inside the head which returns a string like this.</p>
  
  <pre><code>body {
      border: 1px solid silver;
  }
  .mydiv {
      color: blue;
  }
  </code></pre>
  
  <p>Is it possible to do?</p>