I am adding two tags dynamically when i click on remove button(just to make UI look better), I am not able to remove the space that those two BR's added. If i see in console, it is showing me as
(lower case), I have tried uppercase,lowercase . remove().
var container = $("#CCcontainer")
container.append("<div id =" + removeID + " ><div class =\"form-group col-sm-10\"></div><div class =\"form-group col-sm-2\"><button id=\"btn" + removeID + "\" type=\"button\" class=\"btn btn-warning form-control\">Remove Card</button></div></div></BR></BR>");
//Below line is in a remove Card click action.
$( "<br/>" ).remove();
Could someone help jhow to remove this space?
You can use:
$("br").remove();
or more specific by target only <br>
inside your #CCcontainer
div if you don't want to remove all the <br>
in the page like above code then:
$('#CCcontainer br').remove();
Use br
selector for selecting all <br/>
tag
$("br").remove();
You can remove <br>
using CSS or jquery.
CSS Code
#YourContainer br {
display: none;
}
Or Using jQuery
$('br').remove();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With