JSFiddle - React, Tailwind, and code Playground
by FireAnt121
HTML
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<style>
.result {
display:none;
}
</style>
</head>
<body>
<textarea style="width:200px;height:200px" id="first"></textarea>
<textarea style="width:200px;height:200px;" id="second"></textarea>
<button id="submit">submit</button>
<script type="text/javascript">
const firstTextArea = document.querySelector('#first');
const secondTextArea = document.querySelector('#second');
const submitBtn = document.querySelector('#submit')
submitBtn.addEventListener('click' , function(){
let str = firstTextArea.value.replace(/[(?:\r\n|\r|\n),]+/g, '<br>');
secondTextArea.value = str;
})
</script>
</body>
</html>