<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
<style>
*{
margin: 0px;
padding: 0px;
}
#wrap{
border: 1px solid #ccc;
background: white;
width:300px;
height:480px;
margin:0 auto;
position: relative;
margin-top: 10px;
}
#text{
width: 270px;
height: 400px;
border: 1px solid #ccc;
position: absolute;
left: 15px;
top:20px;
}
#face{
width: 24px;
height: 24px;
border: 1px solid #ccc;
display: inline-block;
background: url(images/icon4.png);
left:15px;
top:435px;
position: absolute;
} #writen{
height: 24px;
position: absolute;
top:435px;
left: 50px;
width:180px;
border-radius: 5px; }
#button{
position: absolute; right: 15px;
height: 25px;
width: 40px;
top:435px;
}
.right{
position:absolute;
right:33px;
background:pink;
padding:2px;
} .left{
position:absolute;
left:33px;
background:#ccc;
padding:2px;
} </style>
<script>
window.onload = function (){
var oText = document.getElementById("text");
var oFace = document.getElementById("face");
var aInput = document.getElementsByTagName("input");
var onff = true; aInput[1].onclick = function (){ if(!aInput[0].value){
alert("Please Input");
}
else if( onff){
oText.innerHTML = '<p style="height:25px;line-height:25px;background:#ccc;float:right;margin-right:35px;margin-top:3px;padding:2px;clear:both;"><img src= "images/icon4.png"style="position:absolute;right:5px;">'+ aInput[0].value +'</p>' + oText.innerHTML;
aInput[0].value = "";
}
else {
oText.innerHTML = '<p style="height:25px;line-height:25px;background:pink;float:left;margin-left:35px;margin-top:3px;padding:2px;clear:both;"><img src= "images/icon3.png"style="position:absolute;left:5px;">'+ aInput[0].value +'</p>' + oText.innerHTML;
aInput[0].value = "";
}
}
oFace.onclick = function(){ if(onff){
oFace.style.background ="url(images/icon3.png)";
onff = !onff;
}
else
{
oFace.style.background ="url(images/icon4.png)";
onff = !onff;
}
}
}
</script>
</head>
<body>
<div id = "wrap">
<div id = "text"> </div> <div id = "face"></div>
<input type = "text" id = "writen">
<input type = "button" id = "button" value = "发送"> </div>
</body>
</html>

js 模拟发短信的更多相关文章

  1. js实现发送短信验证码后的倒计时功能(无视页面刷新)

    [1].[代码] 这是页面上的发送验证码按钮 跳至 [1] [2] [3]<input id="second" type="button" value=& ...

  2. html页面通过特殊链接:打电话,发短信,发邮件详细教程

    采用url href链接的方式,实现在Safari  ios,Android 浏览器,webos浏览器,塞班浏览器,IE,Operamini等主流浏览器,进行拨打电话功能. 1. 拨打电话 在电话号码 ...

  3. 移动设备wap手机网页html5通过特殊链接:打电话,发短信,发邮件详细教程

    如果需要在移动浏览器中实现拨打电话,调用sms发短信,发送email等功能,移动手机WEB页面(HTML5)Javascript提供的接口是一个好办法. 采用url href链接的方式,实现在Safa ...

  4. html5开发手机打电话发短信功能

    原文:http://www.open-open.com/code/view/1449843459332 在很多的手机网站上,有打电话和发短信的功能,对于这些功能是如何实现的呢.其实不难,今天我们就用h ...

  5. html5开发手机打电话发短信功能,html5的高级开发,html5开发大全,html手机电话短信功能具体解释

    在非常多的手机站点上,有打电话和发短信的功能,对于这些功能是怎样实现的呢.事实上不难,今天我们就用html5来实现他们. 简单的让你大开眼界.HTML5 非常easy写,但创建网页时,您常常须要反复做 ...

  6. iOS开发之调用系统打电话发短信接口以及程序内发短信

    在本篇博客开头呢,先说一下写本篇的博客的原因吧.目前在做一个小项目,要用到在本应用程序内发验证码给其他用户,怎么在应用内发送短信的具体细节想不大起来了,于是就百度了一下,发现也有关于这方面的博客,点进 ...

  7. 打电话,发短信,发邮件,app跳转

    1.打电话 - (IBAction)callPhone1:(id)sender { NSURL *url = [NSURL URLWithString:@"tel://18500441739 ...

  8. linux下利用GPRS模块发短信、打电话

    一.开发环境     内核版本:linux-3.0    开发板:FL2440(nandflash:K9F1G08 128M)    GPRS模块:SIM900   二.与发短信和拨号相关的 AT 指 ...

  9. iOS中如何切换到发短信、打电话、发邮件

    我们在做APP的时候,难免会遇到需要调用短信,电话等程序的时候.如美团. 当然,这些都只是一些简单的方法就可以实现,但是时间久了也会淡忘,所以想写这边博客.一是为了再捡起来复习一下,另一个相当于留个备 ...

随机推荐

  1. mvc项目限制请求类型

    MVC 5限制所有HTTP请求必须是POST方式 这篇文章讲述了如何限制请求类型.

  2. Struts2 标签库与OGNL的使用

  3. 用 Ipe 画图

    如何画一个箭头 首先要了解一个概念:「path object」. Path objects are objects that are formed with lines or curves, exam ...

  4. [HNOI2007][bzoj1187] 神奇游乐园 [插头dp]

    题面: 传送门 给定一个四联通棋盘图,每个格子有权值,求一条总权值最大的回路 思路: 插头dp基础教程 棋盘? 回路? n,m<=10? 当然是插头dp啦~\(≧▽≦)/~ 然后发现这道题并不是 ...

  5. 2017-2018-2 20179204 PYTHON黑帽子 黑客与渗透测试编程之道

    python代码见码云:20179204_gege 参考博客Python黑帽子--黑客与渗透测试编程之道.关于<Python黑帽子:黑客与渗透测试编程之道>的学习笔记 第2章 网络基础 t ...

  6. HDU [P5015] 233 Matrix

    矩阵快速幂 按列递推 #include <iostream> #include <cstdio> #include <cstdlib> #include <a ...

  7. spfa代码

    先来贴一下,,虽然不是自己写的 #include<iostream>#include<cstdio>#include<cstring>#include<cma ...

  8. android程序入口

    android程序的真正入口是Application类的onCreate方法

  9. 案子前申請 EVB board (Evaluation Board)

    在跑案子前, 需向各 component vendor 申請 EVB board, 其中也包含 mosfet , 以利做實驗, spec 有可能會寫錯 或不清楚, 所以需要使用 EVB board 檢 ...

  10. DOM和jquery对象之间的转换

    <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...