title: Get an Iframe's attribute from within the Iframe
body: <p>When using an iframe, how can I get the value of an attribute from the iframe within the iframe?</p>
  
  <p>Here is my code:</p>
  
  <pre><code>&lt;iframe src="slideriframe.html" name="iframe_a" customAttr="example" style="border:none"&gt;&lt;/iframe&gt;
  </code></pre>
  
  <p>Here is what I have currently:</p>
  
  <pre><code>alert(window.frameElement.getAttribute('customAttr'));
  </code></pre>
  
  <p>Here is the error:</p>
  
  <blockquote>
    <p>Uncaught SecurityError: Failed to read the 'frame' property from
    'Window': Blocked a frame with origin "null" from accessing a frame
    with origin "null". Protocols, domains, and ports must match.</p>
  </blockquote>
  
  <p>Thanks</p>