相关疑难解决方法(0)

如何为HTML标记属性使用多行值?(即如何逃脱换行?)

如何在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," &#10;"可用于HTML属性中的换行符.

html javascript syntax newline

18
推荐指数
3
解决办法
2万
查看次数

标签 统计

html ×1

javascript ×1

newline ×1

syntax ×1