title: jQuery HTML to JSON, including href attribute
body: <p>I have data in markup like this:</p>
  
  <pre><code>  &lt;p class="bbook"&gt;Lorem&lt;/p&gt;
    &lt;p class="bref"&gt;
       &lt;a class="ref" href="prin.v.ii.ii.html"&gt;2:15&lt;/a&gt;
       &lt;a class="ref" href="prin.v.i.v.html"&gt;3:17-19&lt;/a&gt;
       &lt;a class="ref" href="prin.v.v.html"&gt;3:19 &lt;/a&gt;
    &lt;/p&gt;
  
   &lt;p class="bbook"&gt;Ipsum&lt;/p&gt;
   &lt;p class="bref"&gt;
       &lt;a class="ref" href="sec.vii.xxii.html"&gt;10:18&lt;/a&gt;
       &lt;a class="ref" href="sec.vii.ix.html"&gt;10:27&lt;/a&gt;
       &lt;a class="ref" href="sec.vii.xxiii.html"&gt;10:28&lt;/a&gt;
   &lt;/p&gt;
  </code></pre>
  
  <p>I'd like to convert it to a JSON object like this:</p>
  
  <pre><code>{
      "Lorem": {
          "prin.v.ii.ii.html": "2:15",
          "prin.v.i.v.html": "3:17-19",
          "prin.v.v.html": "3:19"
      },
      "Ipsum": {
          "sec.vii.xxii.html": "10:18",
          "sec.vii.ix.html": "10:27",
          "sec.vii.xxiii.html": "10:28"
      }
  }
  </code></pre>
  
  <p>I've seen some HTML to JSON solutions here but none that I can find that deal with attributes. I know it might be easier if the markup had <code>ul</code>'s but it doesn't. How could I convert this?</p>