Valentina
Valentina

Reputation: 59

How to get a reference for Gmail Inbox button?

I want to get a reference to the Gmail Inbox button in Javascript? I tried my code in Firebug console but could not manage to find the right DOM node.

Upvotes: 0

Views: 182

Answers (1)

kennytm
kennytm

Reputation: 523334

return Array.prototype.filter.call(
  document.getElementById("canvas_frame").contentDocument.getElementsByTagName("a"),
  function(x){return /#inbox$/.test(x.href);}
)[0];

Upvotes: 1

Related Questions