The following code works and I am able to raise the alert on click of the body. What I want to do is when the iframe is loaded, automatically change the width of the table in the iframe to 100%. So instead of click, how can I change the width onload?
$("iframe[name=myheader]").load(function() {
var iframe_body = window.myheader.document.getElementsByTagName("body")[0];
$(iframe_body).click(function() {
alert("hello, you touched me~");
$(this).find("table").css("width","100%");
});
});