Guy Guy - 5 months ago 61
Javascript Question

jquery selector not working in Gmail

I'm using Jquery to modify the Google navigation toolbar (the black one).

This selector works on and some other google sites like Google Plus (


(this selects the li items in the toolbar)

But for some reason, inside gmail, this selector doesn't work. The structure of the page seems exactly the same on and in the other google sites, but this selector doesn't return anything when run in gmail.

Any ideas?


The contents(including the toolbar) of Gmail unlike other google-pages are loaded within an iframe.

So when you use this code from the top-document you must pass the iframe-document as context(2nd argument for $() )