Javascript examples for String Operation:String URL
Check and validate url starts with http://
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> function checkUR(abc){/*from w w w .j av a2 s . co m*/ string = abc.value if(!(/^http:\/\//.test(string))){ string = "http://" + string; } abc.value=string } </script> </head> <body> <form> <input type="url" name="someUrl" onkeyup="checkUR(this)"> </form> </body> </html>