Created
January 3, 2013 10:23
-
-
Save anonymous/4442461 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// First, open the devtools (firefox nightly). Then execute this: | |
let iframe = document.getElementById("devtools-toolbox-bottom-iframe"); // we have an iframe | |
//... then we add a class to this node: | |
let CLASS_NAME = "foobar"; | |
iframe.className = CLASS_NAME; | |
iframe.setAttribute("class", CLASS_NAME); // trying both ways | |
alert("why is this null: " + document.querySelector("." + CLASS_NAME)); | |
alert("... and this is true: " + iframe.mozMatchesSelector("." + CLASS_NAME)); | |
alert("... and this undefined: " + document.getElementsByClassName(CLASS_NAME)[0]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Execute this code in a chrome scratchpad after opening the devtools (the web console for example).
I filed a bug: https://bugzilla.mozilla.org/show_bug.cgi?id=826202