如何在多行中显示字符串? [英] How do I display a String in multiple lines?

查看:120
本文介绍了如何在多行中显示字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是html代码段:



The following is a html code segment:

<tr>
<td>Address</td>
<td><table>
<tr><td><input type="text" class="text"     name="address1" placeholder="Address line1" /></td></tr>
<tr><td><input type="text" class="text"     name="address2" placeholder="Address line2" /></td></tr>
<tr><td><input type="text" class="text" name="address3" placeholder="Address line3" /></td></tr>
</table>
</td>
</tr>







我有一个地址会话范围内的字符串。




I have an address string in session scope.

value="${sessionScope.updatePersonBean.address}"



这个字符串有三个其中的地址行。



现在,我需要在html表单的三个输入地址行中的每一行中显示每一行作为默认值。


This string has three lines of address in it.

Now, I need to display each line as the default value in each of the three input address lines in the html form.

推荐答案

{sessionScope.updatePersonBean.address}
{sessionScope.updatePersonBean.address}"



此字符串中包含三行地址。



现在,我需要在html表单的三个输入地址行的每一行中显示每一行作为默认值。


This string has three lines of address in it.

Now, I need to display each line as the default value in each of the three input address lines in the html form.


你可以使用JavaScript字符串拆分功能删除分隔符上的地址并将每个地址分配给相应的DOM元素。
You can use the JavaScript string split function to split the address on the separator and assign each address to the appropriate DOM element.


HTML行分隔符为< / br> : - )。



-SA
HTML line separator is </br> :-).

—SA


这篇关于如何在多行中显示字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆