输入框的使用

获取各个文本框的内容,将获取的字符串整合到textarea显示

代码

HTML

<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<!-- <link rel="stylesheet" type="text/css" href="style.css"> -->
		<script src="jisuanqi.js"></script>
		<style>
			.num1{
			width:30px;
			}
		</style>
	</head>
	<body>
		<input class="num1" id="num1" type="text">+
		<input class="num1" id="num2" type="text">=
		<input class="num1" id="num3" type="text" >
		<input id="sum" type="submit" value="运算" onclick="calc()">
	</body>
</html>

  CSS:

.top{
	margin-top:10px;
	margin-left:5px;
	width:680px;
	height:112px;
	/* background-color:#cccccc; */
}
.middle{
	width:680px;
	height:45px;
	margin-left:5px;
	/* background-color:#aaaaaa; */
}
.bottom{
	width:680px;
	height:200px;
	margin-left:5px;
	/* background-color:#3355bb; */
}
.tt{
	width:150px;
	height:112px;
	margin-right:5px;
	float:left;
}
.tt1{
	width:160px;
	height:112px;
	margin-right:20px;
	font-size:16px;
	float:left;
}
.text1{
	margin-top:7px;
}
.o{
	margin-top:5px;
	border:solid 1px lightgray;
}
.button{
	width:77px;
	height:30px;
	margin-left:450px;
}
.textarea{
	width:673px;
	height:200px;
	font-size:15px;
}

JavaScript:

function print(){
	//读取文本框输入的值
adress=document.getElementById('adress').value;
company=document.getElementById('company').value;
money=document.getElementById('money').value;
unit=document.getElementById('unit').value;
type=document.getElementById('type').value;
name=document.getElementById('name').value;
production=document.getElementById('production').value;
	str=adress+"最大的"+type+company+"倒闭了。XXX老板"+name+"吃喝嫖赌,欠下"+money+"个亿,带着他的家眷跑路了!我们没有办法,拿着"+production+"抵工资!原价都是一"+unit+"多、两"+unit+"百多的"+production+",现在全部只卖二十块,统统只要二十块!"+name+"XXX,我们辛辛苦苦给你工作大半年,你不发工资,你还我们血汗钱钱!"
	document.getElementById('text').value=str;
}

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值