Can I add a <br/> and links to a javascript alert?

Xaisoft提出了一个问题:Can I add a
and links to a javascript alert?,或许与您遇到的问题类似。

回答者Daniel Schaffer给出了该问题的处理方式:

You can't use HTML, but you can add line breaks:

alert('line1\nline2');

If a rich modal popup is really what you want though, you can use jQuery's dialog feature and put whatever you want in there.

希望本文对你有帮助,欢迎支持JavaScript中文网