JSFiddle - React, Tailwind, and code Playground

by Dedi Wibisono

HTML

<textarea name="" id="text" cols="30" rows="10"></textarea>
<button class="click">cek</button>
<div class="result"></div>

JavaScript

$('.click').click(()=>{
	var text = $('#text').val()
  /* alert(1) */
  $('.result').html($('#text').val().replace(/\n\r?/g, '<br />'));
})