如何打破一行java脚本

une*_*eer 1 javascript jquery

我正在通过java脚本设置h4的文本我想要做的是在这里添加新行代码

$("#description").text("for CCAET and has received significant international scientific recognition. <br /> \n Dr. Armogan has also been responsible for many surgical firsts in retina and cataract management.");
Run Code Online (Sandbox Code Playgroud)

现在我尝试了多种解决方案,但仍然没有在这里工作的另一个

$("#description").text("or CCAET and has received significant international scientific recognition.Dr. Armogan has also been responsible for many surgical firsts in retina and cataract management."+
                        "abc"+
                         "def");
Run Code Online (Sandbox Code Playgroud)

任何帮助?

And*_*tel 6

尝试$("#description").html(...)而不是$("#description").text(...).

  • 并且```换行 (2认同)
  • @uneebmeer如果有效,请接受答案 (2认同)