Remove elements from the DOM using .remove()

.remove()


Description: Remove elements from the DOM.


Example:

<!doctype html>
    <html lang="en">
    <head>
      <meta charset="utf-8">
      <title>remove demo</title>
      <script src="http://code.bitsycode.com/bitsycode-latest.min.js"></script>
      
    </head>
    <body>
      
      <ul>
         <li>One</li>
         <li>Two</li>
         <li class="removeThis">Five</li>
         <li>Three</li>
      </ul>
      
      <script>
         
         bitsyCode.ready(function(){
            bitsyCode('.removeThis').remove();
         })
         
      </script>
     
    </body>
    </html>

Preview:

<ul>
   <li>One</li>
   <li>Two</li>
   <li>Three</li>
 </ul>
  • Usage

    • How to use:

      Use the .remove() to remove elements from the DOM.

    • USAGE:

      bitsyCode("element").remove();
  • Options

    • What options are there:

      There are no options for this method.

  • Returns

    • Returns: No return type

      This method does not need to return any type.

Share