JSFiddle - React, Tailwind, and code Playground
by bobbyrne01
HTML
<input type="text" id="separator" value="Doesnt\nwork" />
<input type="button" id="button" value="submit" />
JavaScript
document.getElementById('button').onclick = function(){
alert(document.getElementById('separator').value);
alert("This\nworks");
};