老师要求做的,搞了好久不会
HTML 输入框输入内容问题 例如 输入框里输入网址按提交的时候自动把点号替换#井号 这个怎么实现 HTML 的 求指点~~
1
Biwood 2015-11-02 23:24:35 +08:00
这种问题实在太低端了,只有我这么有闲情来回答么,看看吧 http://output.jsbin.com/luyuce
|
2
m939594960 2015-11-02 23:30:14 +08:00
|
3
hongqigong OP @Biwood 跳转到支付宝上替换成# 这个怎么实现。 看下这个代码怎么来改,小白不懂。
<html> <head> <meta charset="utf-8"> <!-- Created using JS Bin http://jsbin.com Copyright (c) 2015 by oodzchen ( http://jsbin.com/luyuce/3/edit) Released under the MIT license: http://jsbin.mit-license.org --> <meta name="robots" content="noindex"> <title>JS Bin</title> </head> <body> <form id="gongyi" name="gongyi" target="_blank" method="post" action="https://shenghuo.alipay.com/send/payment/fill.htm" accept-charset="GBK"> <input type="hidden" name="optEmail" value="支付宝帐号"> <input type="text" name="memo" id="text" value="填写邮箱 "> <input id="payAmount" type="hidden" name="payAmount" value="0.01"> <input id="title" type="hidden" name="title" value="备注"> <input type="image" name="juanzeng" value="支付宝" src="img/gongyi.jpg"> </form> <script> var text = document.getElementById('text'); var btn = document.getElementById('btn'); btn.onclick = function(){ alert(text.value.replace(/\./g, '#')); }; </script> <script src="http://static.jsbin.com/js/render/edit.js?3.35.3"></script> <script>jsbinShowEdit && jsbinShowEdit({"static":"http://static.jsbin.com","root":"http://jsbin.com"});</script> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-1656750-34', 'jsbin.com'); ga('require', 'linkid', 'linkid.js'); ga('require', 'displayfeatures'); ga('send', 'pageview'); </script> </body> </html> |
4
hongqigong OP 问题解决~~
|