title: Viewer.JS File Name from Title Attribute
body: <p>I'm using viewer.js (<a href="http://viewerjs.org/" rel="nofollow">http://viewerjs.org/</a>) to view pdf's on a website, and I want to pull the attribute "title" from the iframe code to title the document.</p>
  
  <p>At the moment the code is as follows</p>
  
  <p><code>&lt;iframe id="viewer" src = "/ViewerJS/#../demo/ohm2013.odp" width='400' height='300' allowfullscreen webkitallowfullscreen&gt;&lt;/iframe&gt;</code></p>
  
  <p>and I want to be able to do this</p>
  
  <p><code>&lt;iframe id="viewer" src = "/ViewerJS/#../demo/ohm2013.odp" width='400' height='300' allowfullscreen webkitallowfullscreen title="Document Title"&gt;&lt;/iframe&gt;</code></p>
  
  <p>I know the bit of code in the js file I need to edit is as follows</p>
  
  <pre><code>document.getElementById("documentName").innerHTML=document.title
  </code></pre>
  
  <p>and I tried the following but with no luck</p>
  
  <pre><code>document.getElementById("documentName").innerHTML=document.attr('title')
  </code></pre>
  
  <p>I'm just not sure how to get the attribute.</p>
  
  <p>The full source code for viewer.js can be viewed at <a href="http://viewerjs.org/ViewerJS/viewer.js" rel="nofollow">http://viewerjs.org/ViewerJS/viewer.js</a></p>