Home > Article > Web Front-end > Js carriage return and line feed processing methods and application of replace method_javascript skills
When we enter text in the text box and press Enter, we hope that the web page will also display a line break effect after submission. At this time, we need to process the submitted content
to achieve the effect.
1. Define js native replacement function . There is no replaceAll function in js, we need to customize