access div in iframe parent

I have a page which contains an iframe to another page, what I am looking for is to click something inside the iframe, which can then access or more specifically hide a div in the parent. I know some JQuery but for some reason just sit there blankly at the code editor when I try to write it on my own


Solution 1:

try this in iframe:

$('#DIVtobehidden', window.parent.document).hide();

Solution 2:

$("#element-In-Iframe").on('click', function() {
    $('#element-in-parent-window', window.parent.document).hide();
});

FIDDLE