Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I access an element in an Iframe
    primarykey
    data
    text
    <blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/1088544/javascript-get-element-from-within-an-iframe">Javascript - Get element from within an iFrame</a> </p> </blockquote> <p>I'm trying to select options using greasemonkey on page. document.getElementById("q10") is returning null. I'm sure it's something to do with the iframe, but I don't know how to access it.</p> <p>Here is where the iframe is loaded.</p> <pre><code> &lt;td valign="top" height="88%" colspan="2"&gt; &lt;iframe id="initialtextFrame" name="initialtextFrame" title="Survey Questions" frameborder="0" scrolling="auto" style="height: 100%; width: 100%" src= '/hc/64261160/?cmd=file&amp;amp;file=preChatSurveyContent&amp;amp;site=64261160&amp;amp;sessionkey=H909985739716063515-5531034935655418229K8398902&amp;amp;survey=Pre-Chat' &gt;This functionality requires frames.To read the LivePerson accessibility policy, please go to the &lt;a href='http://www.liveperson.com/help/accessibility.asp'&gt;Liveperson accessibility policy page&lt;/a&gt;.&lt;img src="/hcp/window3/common/trans.gif" width="10" alt="" /&gt;&lt;/iframe&gt; &lt;/td&gt; </code></pre> <p>This is the select option I am trying to select within the frame</p> <pre><code>&lt;select tabindex="3" name="ude!1841972" id="q10" size="1"&gt; &lt;option id="q10r0" value="" label="" selected='selected'&gt;Select One&lt;/option&gt; &lt;option id="q10r1" value="Chat-Field Tech-Denver Metro" label="Chat-Field Tech-Denver Metro" &gt;Chat-Field Tech-Denver Metro&lt;/option&gt; &lt;option id="q10r2" value="Chat-Field Tech-CO Springs-SLC, UT" label="Chat-Field Tech-CO Springs-SLC, UT" &gt;Chat-Field Tech-CO Springs-SLC, UT&lt;/option&gt; &lt;option id="q10r3" value="Chat-Field Tech-Outstate CO-MT-UT-Wy" label="Chat-Field Tech-Outstate CO-MT-UT-Wy" &gt;Chat-Field Tech-Outstate CO-MT-UT-Wy&lt;/option&gt; &lt;/select&gt; </code></pre> <p>Trying document.getElementById("q10r3") and "q10" both return null</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload