jQuery - Trying to select element from iFrame (point and click) -


I am trying to get the name of the ID and element from the HTML tag. This code works:

  jQuery (document) .ready (function () {$ ("*", document.body) .mousemove (function (e) {$ ('# mpos ') .html (e.pageX +', '+ e.pageY); e.stopPropagation (); var domEl = $ (this) .get (0); $ (' # elem '). Html (domEl.tagName ); $ ('# Ide') .HTML (domEl.id);});});  

But I want to work it inside an iframe too. If I try now, it only displays the element name and the element name of the iframe.

Thanks in advance!

This is because the page only sees iframe as an element. If you want to select different elements in the iframe, you will need to repeat the script on the page inside the iframe. But you will not be able to pass it to the parent page AFAIK.

If you have control over IFrame and its contents, then you will be better off right into the original document and using overflow: scroll using the CSS rule.


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -