First, preface
Some days ago, customers request production in the mobile phone site to create a text messaging function, you can send information to fixed mobile phone number, the other is very simple, let's show the following.
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/6D/DA/wKioL1VtrfOxwpM0AAHfg7B0KKk777.jpg "title=" Msg.jpg "alt=" Wkiol1vtrfoxwpm0aahfg7b0kkk777.jpg "/>
Second, HTML code
<form> <p><textarea name= "online" id= "online" placeholder= "Please enter text" ></textarea></p> <p class= "Online_button" ><a href= "sms:15812345678?body=" class= "btn" > Confirm send </a></p> <!-- The body is followed by the message content to be sent--></form>
Third, JS code
<script type= "Text/javascript" > $ (function () { $ (". Online_1 form a"). Bind (' click ', Function () { //get the value in the input box var textarea = $ ("#online"). Val (); //Determine if the input box is empty if (textarea == null| | textarea == "") { alert ("Please enter the message content to be sent!") "); return false; }else{ &When nbsp; //is not empty, the input is added to the back of the sending message var href = $ (". Online_1 form a"). attr ("href"); var msg = href+textarea; $ (". Online_1 form a"). attr ("href", msg); } }); });</script>
This article from "Make a snail really good" blog, please be sure to keep this source http://smili.blog.51cto.com/8919945/1657652
Mobile Web Click button to send SMS to the specified number