How to assign click event to elements inside ifraem?
I started a post to detect if the iframe is loaded.
How can I detect whether an iframe is loaded?
and I have further quesitons
How do I assign an event or manipulate elements inside the iframe??
I tried..
$(function(){
$('#click').on('click', function(){
var ifr=$('<iframe></iframe>', {
id:'MainPopupIframe',
src:'http://heera.it',
style:'display:none',
load:function(){
$(this).show();
alert('iframe loaded !');
}
});
$('body').append(ifr);
//when I click the home page button, nothing happen...
$('#menu-item-277').click(function(){
alert('click!!!');
})
});
});
Thanks for the help.