日期:2014-05-16 浏览次数:20425 次
<!DOCTYPE HTML> <html> <head> <meta charset="gb2312" /> <title></title> <style> </style> </head> <body> <input id="a" /> <button id="btn">测试</button> <script> function $(o){return document.getElementById(o);} var re = /^http:\/\/.+$/i; $('btn').onclick = function(){ var t = $('a').value; alert(re.test(t)) } </script> </body> </html>