tags:

views:

19

answers:

2

For some reason, getElementById() and getElementsByClassName() cannot locate many of the elements on gmail. For example, the div entitled "Mail" on the navigation bar has the code:

<div id=":qy" class="z9 z8 T2"><span class="is">Mail</span><div class="Ww4Jzd"></div></div>

Yet running document.getElementById(":qy") in the Chrome console doesn't find it. What am I missing?

+2  A: 

They are in iframes. This should do it:

document.getElementById('canvas_frame').contentWindow.document.getElementById(':qy')
meder
A: 

IDs may not start with a colon.

RoToRa