<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("button").click(function(){
var text = $("body").html();
var text2 = $("body").val();
$("body").html(text.replace(" ","<br>").replace(")",")<br>"));
});
});
</script>
</head>
<body>
Hello (IT邦幫忙) ~
<button>換行</button>
</body>
</html>
簡單概念提供給你 :)