title: jQuery .load by element ID
body: <p>Hi I'm trying to load an element from a webpage via ID. </p>
  
  <p>My code reads the url from the 'href' attribute of the  tag and then loads the page. I'm stripping the document anchor.</p>
  
  <p>This script <strong>works</strong> but won't discard the surround elements and loads the entire page.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $(function() {
      var a_href = $('#pycom').attr('href').split('#');
      $('div#pop-up').load(a_href[0] + '#synopsis');
  });
  &lt;/script&gt;
  
  &lt;body&gt;
      &lt;a id="pycom" href="content/documentation/CommandsPython/ls.html#hFlags"&gt;ls&lt;/a&gt;
  &lt;/body&gt;
  </code></pre>
  
  <ul>
  <li><a href="http://help.autodesk.com/cloudhelp/2015/ENU/Maya-Tech-Docs/CommandsPython/ls.html" rel="nofollow">http://help.autodesk.com/cloudhelp/2015/ENU/Maya-Tech-Docs/CommandsPython/ls.html</a></li>
  </ul>
  
  <p>The above link exists locally on my server (XAMPP) as per the 'html' code above.</p>
  
  <p>Below is the element I would like to extract.</p>
  
  <pre><code>&lt;p id="synopsis"&gt;
      &lt;code&gt;
          xform([objects...], 
          [&lt;a href="#flagabsolute"&gt;absolute&lt;/a&gt;=&lt;i&gt;boolean&lt;/i&gt;], 
          [&lt;a href="#flagboundingBox"&gt;boundingBox&lt;/a&gt;=&lt;i&gt;boolean&lt;/i&gt;],
          .....
          .....
  
      &lt;/code&gt;
  </code></pre>
  
  <p></p></p>
  
  <p>Thanks</p>
  
  <p>Jamie</p>