Welcome aboard! We are happy you are here and wish you good net-raft!
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
function convert_string(str) {
var regex = /<br\s*[\/]?>/gi;
str = str.replace(regex, "every");
return str;
}
function convert() {
var class1 = document.getElementById("div1").value;
var class2 = document.getElementById("div1");
var text = convert_string(class1);
class2.value = text;
}
</script>
</head>
<body>
<button onclick="convert()">click</button>
<hr>
<div>Result:</div>
<hr>
<input type="text" id="div1" value="Hello <br>body!">
</body>
</html>
The most helpful JAVASCRIPT solutions
How can I get the last day and the next day in javascript ?JAVASCRIPT Click to see more ... 6K 508