单击按钮后文本框中的内容会分两行显示

如题所述

<body>
<input id="Text1" type="text" />
<input id="Button1" type="button" value="button" onclick="Show()" />
<script type="text/javascript">
function Show() {
if (Text1.value == "") {
alert("内容为空")
}
else {
alert("内容是:" + Text1.value);
}
}
</script>
</body>
温馨提示:答案为网友推荐,仅供参考
相似回答