Jquery method to remove br: 1. Get the br element, the syntax is "$("br")", which will return a jquery object containing the specified element; 2. Use the remove() function to remove the obtained The br element object is sufficient. The syntax is "br element object.remove()", which will delete the br element and all text and child nodes in it.
The operating environment of this tutorial: windows10 system, jquery3.2.1 version, Dell G3 computer.
remove() method with jquery removes selected elements, including all text and child nodes.
This method will also remove the data and events of the selected element.
The syntax is:
$(selector).remove()
The example is as follows:
Output result:
Related video tutorials Recommended:jQuery video tutorial
The above is the detailed content of How to remove br in jquery. For more information, please follow other related articles on the PHP Chinese website!