JSFiddle - React, Tailwind, and code Playground

by Huy Dinh

HTML

<p>Click the button to replace "Microsoft" with "W3Schools" in the paragraph below:</p>

<p id="demo">Visit 2,004 (1
)!</p>

<input type="submit" text="Try it" onclick="myFunction();"></input>

JavaScript

var str = document.getElementById("demo").innerHTML;
alert(str);
var res = str.replace(/(<br>)/g, '');
alert(res);