Showing posts with label Firebug. Show all posts
Showing posts with label Firebug. Show all posts

Tuesday, January 22, 2013

Finding elements within iframe using firebug


Firebug Tip

Firebug command line allows executing JavaScript expressions within context of the current page. Firebug also provides a set of built in APIs and one of them is cd().

Lets consider below iframe

                <iframe id="testID" name="testName" src="iframe.html" />


  • cd(document.getElementById("testID").contentWindow); switch to a frame by ID
  • cd(window.frames[0]); switch to the first frame in the list of frames
  • cd(window.frames["testName"]); switch to a frame using by name
  • cd(window.top); switching back to the top level window


Happy Coding .. :)


Regards,
SantoshSarma