jQuery conflict when removing div after page load

后端 未结 8 458
北海茫月
北海茫月 2021-01-13 07:07

I\'m trying to remove a div from the page (preferably prevent it from loading at all) but for now I\'m settling on removing it after the page loads.

When I try the f

相关标签:
8条回答
  • 2021-01-13 08:02

    You are using jQuery testing with onload,

    so you have to add onload syntax in jquery, on your site the statement was not called onload, that why its not working

    I have updated fiddle

    http://jsfiddle.net/MarmeeK/FRYsJ/3/
    

    The JS code under <script> tag, without adding in onload in page,

    <script type="text/javascript">
        $(document).ready(function(){$('#content').remove();});
    </script>
    

    this should work :)

    0 讨论(0)
  • 2021-01-13 08:03

    Try with this

    <script type='text/javascript'> 
        $(document).ready(function(){
             $('#content').remove();
        });
    </script>
    

    or

    $(function()
    {
            $('#content').remove();
    });
    
    0 讨论(0)
提交回复
热议问题