How do I target an element inside of an iframe I've created on the page? In
other words, I've used jQuery to create an iframe, and now I need to target
all the p elements of the document inside that iframe. 

I've tried

 $("p",self.MyIFrame.document).click(function(){alert('asdf');});

and also

 $("p",oIframe).click(function(){alert('asdf');});

where oIframe is 
var oIframe = document.getElementById("if");

The frame generated by jquery is straightforward:

 $('div#results').empty().append('<iframe src="'+t+'" frameborder="1"
width="90%" height="300px" id="if" name="MyIFrame"></iframe>');

Thanks.

-- 
View this message in context: 
http://www.nabble.com/Target-iframe-generated-by-jquery-tf3227636.html#a8966165
Sent from the JQuery mailing list archive at Nabble.com.


_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to