test2.html
<!DOCTYPE html>
<html>
<head>
<title>阶段性练习2</title>
<meta name="keywords" content="keyword1,keyword2,keyword3">
<meta name="description" content="this is my page">
<meta name="content-type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript">
/* <div align="center">
<span>地名:</span> <input type="text" id="location" value="大连">
<span>公司类型:</span> <input type="text" id="companyType" value="Java培训公司">
<br>
<span>公司名称:</span> <input type="text" id="companyName" value="阿里发发">
<span>老板姓名:</span> <input type="text" id="bossName" value="XKJ">
<br>
<span>多少钱:</span> <input type="text" id="money" value="六六六">
<span>产品:</span> <input type="text" id="product" value="肉包子">
<br>
<span>单位:</span> <input type="text" id="unit" value="块">
</div> */
function generate(){
var location = $("location");
var companyType= $("companyType");
var companyName= $("companyName");
var bossName= $("bossName");
var money= $("money");
var product= $("product");
var unit= $("unit");
var result = location +"最大"+companyType+companyName+"倒闭了,王八蛋老板"+bossName+"吃喝嫖赌,欠下了"+money+"个亿,"
+ "带着他的小姨子跑了!我们没有办法,拿着"+product+"抵工资!原价都是一"+unit+"多、两"+unit+"多、三"+unit+"多的"+product+","
+ "现在全部只卖二十块,统统只要二十块!"+bossName+"王八蛋,你不是人!我们辛辛苦苦给你干了大半年,"
+ "你不发工资,你还我血汗钱,还我血汗钱!";
document.getElementById("result").value = result;
}
function $(id){
var value = document.getElementById(id).value;
return value;
}
</script>
<style type="text/css">
body{
font-family: 宋体;
}
span{
display:inline-block;
border: 1px solid lightgray;
width:120px;
margin-bottom:5px;
}
button#generate{
width:80px;
height:30px;
}
textarea{
width:100%;
height:150px;
margin-top:20px;
}
</style>
</head>
<body>
<div align="center">
<span>地名:</span> <input type="text" id="location" value="大连">
<span>公司类型:</span> <input type="text" id="companyType" value="Java培训公司">
<br>
<span>公司名称:</span> <input type="text" id="companyName" value="阿里发发">
<span>老板姓名:</span> <input type="text" id="bossName" value="XKJ">
<br>
<span>多少钱:</span> <input type="text" id="money" value="六六六">
<span>产品:</span> <input type="text" id="product" value="肉包子">
<br>
<span>单位:</span> <input type="text" id="unit" value="块">
</div>
<br>
<div align="center">
<button id="generate" onclick="generate()">生成海量俚语</button>
<br>
<textarea id="result">
大连最大Java培训公司阿里发发倒闭了,
王八蛋老板XKJ吃喝嫖赌,欠下了六六六个亿,
带着他的小姨子跑了!我们没有办法,拿着贴膜抵工资!
原价都是一块多、两块多、三块多的肉包子,现在全部只卖二十块,
统统只要二十块!XKJ王八蛋,你不是人!我们辛辛苦苦给你干了大半年,
你不发工资,你还我血汗钱,还我血汗钱!
</textarea>
</div>
<br>
</body>
</html>