Remove
in mobile and tablet using JQuery

JS Code Snippets/Functions

This tutorial will teach you how to remove “<br/>” tags on mobile and tablet. Follow the instruction below:

  1. Open your jqueryfile.js
  2. Copy and paste the code below
function remove_br(){
        if( $(window).width() < 900 ) {
            $( ".your-class-here br" ).remove();
            $( ".your-class-here-2 br" ).remove();
        }
}

// Function Call
$(document).ready(function () {
   remove_br();
});

notes:

  • You can change the breakpoints on where you want this function to run. Just change the “900” to your preferred breakpoints.
  • Just change the class in your “.your-class-here” where you want your <br/> to be remove.
  • Reminder that the class would be most likely a parent of your <br/> tag hence why the code is like this “$( “.your-class-here br” ).remove();”
  1. after adding the code above, click save and you are done.

note: if you are having trouble using this, just contact the author of this post.

Leave a Reply

Your email address will not be published. Required fields are marked *