<!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. Linux互斥锁、条件变量和信号量

    Linux互斥锁.条件变量和信号量  来自http://kongweile.iteye.com/blog/1155490 http://www.cnblogs.com/qingxia/archive/ ...

  2. Corrupt block relative dba: 0x04c20df1

    alert日志报以下提示: Corrupt block relative dba: , block ) Fractured block found during backing up datafile ...

  3. ZOJ 2112 Dynamic Rankings(带修改的区间第K大,分块+二分搜索+二分答案)

    Dynamic Rankings Time Limit: 10 Seconds      Memory Limit: 32768 KB The Company Dynamic Rankings has ...

  4. 洛谷P1822 魔法指纹 【分块打表】

    题目 对于任意一个至少两位的正整数n,按如下方式定义magic(n):将n按十进制顺序写下来,依次对相邻两个数写下差的绝对值.这样,得到了一个新数,去掉前导0,则定义为magic(n).若n为一位数, ...

  5. iOS指向函数的指针和block

      一:block基础知识 block基础知识 基本概念:block是用来保存一段代码的:^:是block得标志  好比*:是指针的标志 特点:1:保存一段代码: 2:可以有参数和返回值: 3:可以作 ...

  6. 自动合并多个文件如js css等 可以增加效率

    原文发布时间为:2011-01-13 -- 来源于本人的百度文章 [由搬家工具导入] 原文地址:http://www.codeproject.com/KB/aspnet/HttpCombine.asp ...

  7. js5:框架的使用,使框架之间无痕连接

    原文发布时间为:2008-11-08 -- 来源于本人的百度文章 [由搬家工具导入] <html> <head> <base target="js4" ...

  8. DBus介绍

    1. 介绍 DBus是一种桌面环境的进程间通讯(IPC)机制,有低时延.低消耗等优点 基于socket,提供了一对一的对等通讯:使用dbus-daemon作为后台进程时,可实现多对多通讯 由如下三个层 ...

  9. activity dialog生命周期

    Android生命周期包括以下几个状态: onCreate(Bundle savedInstanceState):可以进行一些初始化的工作在activity第一次被创建的时候调用.这里是你做所有初始化 ...

  10. [Machine Learning with Python] Data Preparation by Pandas and Scikit-Learn

    In this article, we dicuss some main steps in data preparation. Drop Labels Firstly, we drop labels ...