2021年12月7日 星期二

[Jquery] 文字換行

 $(this).html($(this).text().replace(new RegExp("\n", "gm"), "<br/>"))

 gm代表全部替換

沒有留言:

張貼留言

Visual Studio JS intellisense 失效解決方式

  試了好久,發現到工具>選項>IntelliCode js項目設定啟用,重新開啟VS就正常了! 後來發現是TypeScript3.2版有問題停用,使用4.3版的TypeScript即可