框架中输入电话号码后按确定跳到一个网页。
怎样写HTML?
比如(这里填入手机号码)点击确认
会出现在下面这个链接里。http://www.xxxx.com/sds/sdfsd?fsd手机号码sdfr.eft.com
------解决方案--------------------
<input id="phone_num"> <input type="button" id="btn_submit" value="提交"> <div id="result"></div> <script> var $ = function(id){return document.getElementById(id);} $('btn_submit').onclick = function(){ var src = "http://www.xxxx.com/sds/sdfsd?fsdsdfr.eft.com"; $('result').innerHTML = src.replace(/sdsd/, "sd"+$('phone_num').value+"sd"); } </script> <br><font color="#e78608">------解决方案--------------------</font><br>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>无标题文档</title> <script> function test(){ var tel = document.form.phone.value; alert("phone-->>"+tel); var url = "http://www.xxxx.com/sds/sdfsd?fsd"+tel+"sdfr.eft.com"; alert("url-->>"+url); } </script>