I am developing a Greasemonkey script to append a div right after the body tag, here is the jQuery:
$("body:first").append (
'<div id="btn" style="width:50px;display:block">SHOW</div> <div id="gmPopupContainer" style="display:none">my text here</div>'
);
It works fine as long as there is only one body tag on the page, but a problem arises when there are iframes on the webpage. It appends to all the body nested in the iframes.
I've tried many jQuery selectors without success. What is the correct way to do this?