如何在HTML标记属性中包含换行符?
例如:
<a href="somepage.html" onclick="javascript: foo('This is a multiline string.
This is the part after the newline.')">some link</a>
Run Code Online (Sandbox Code Playgroud)
编辑:抱歉,不好的例子,如果标签碰巧不在javascript中,请说:
<sometag someattr="This is a multiline string.
This is the part after the newline." />
Run Code Online (Sandbox Code Playgroud)
编辑2:结果是字符串中的换行符不是我的问题,它是我调用的javascript函数.FWIW," "可用于HTML属性中的换行符.