简体   繁体   中英

How to rewrite removeChild from JavaScript to jQuery

I have this JavaScript in the head of my page.

<script type="text/javascript">
    var nojscss = document.getElementById('nojscss');
    nojscss.parentNode.removeChild(nojscss);
</script>

I would like rewrite it in jQuery to run when the page is loading.

I'm pretty new to jQuery do you have an idea how to do it?

<script type="text/javascript">
    $('#nojscss').remove();
</script>

Try this:

<script type="text/javascript">
    $("#nojscss").remove();
</script>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM