如何使用println在Java中打印单独的行?
<script language = "javascript">
document.write("Your name is:" + fullName);
document.write("You were born in:" + birthYear);
document.write("You already had your birthday this year");
document.write("Your age is an <i>even</i> number.");
</script>
答案 0 :(得分:1)
您需要将数据打印为html,因为这是浏览器读取数据的方式。它不像Java中的控制台。要制作多行,您应该为每行使用段落标记,或者最后使用片段标记。
document.write("<p>Your name is:" + fullName + "</p>");
document.write("Your name is:" + fullName + "<br />");
答案 1 :(得分:0)