Remove iframe element

0

Hello, I'm trying to remove an element that is inside an iframe, I'm even trying to add a class via jquery but without success, I already tried to load jQuery, setTimeout and onLoad by calling a callback but without success.

Someone has a solution to help me.

Note: Passing any command via console in the development tool works.

Iframe

<iframe id="frame" onload="callback(this)" src="{URL}" width="100%" height="100%"></iframe>

jQuery

<script type="text/javascript">
    function callback() {
        alert('Carregado');
        $('#elementoParaRemover').remove();
    };
</script>
    
asked by anonymous 22.05.2018 / 14:38

1 answer

0

Friend you can use remove from jquery:

$("#idFrame").contents().find("#element").remove();

I hope I have helped.

    
22.05.2018 / 14:43