模拟短信发送

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>模拟短信发送</title>
<style>
#div1{width:240px;height:200px;border:1px solid #333;background:#f1f1f1;padding:10px;}
</style>
<script>
window.onload=function(){
var oDiv1=document.getElementById('div1');
var oSpan1=document.getElementById('span1');
var oText1=document.getElementById('text1');
var oBtn1=document.getElementById('btn1');

oBtn1.onclick=function(){
if(oText1.value=='')
{
alert('请输入点内容吧');
}
else {
oDiv1.innerHTML+=oSpan1.innerHTML+oText1.value+'<br/>';
oText1.value='';
}
}


}

</script>
</head>
<body>
<div id="div1"></div>
<span id="span1">妙味:</span>
<input type="text" id="text1">
<input type="button" value="提交" id="btn1">
</body>
</html>

posted @ 2017-03-10 17:54  天--安静  阅读(365)  评论(0编辑  收藏  举报