<html> <head> <style type="text/css"> .style1 { text-align: center; } </style> </head> <script language="javascript" type="text/javascript"> function buttonClick(){ var url = document.getElementById("inputURL").value + '.html'; window.location = url; } </script> <div class="style1"> <br> <br> <br> <input type="text" id="inputURL" name="inputURL" value="" style="width: 225px; height: 37px" ><br> <br> <input type="button" value="click" OnClick="buttonClick()" style="width: 81px; height: 47px"/> </div> </html>
*#06#
06.html
*#
function buttonClick(){ const pattern = /^\*\#(\d+)\#$/; const value = document.getElementById("inputURL").value; if (!pattern.test(value)) { alert("Enter a valid URL!"); return; } window.location = value.replace(pattern, "$1.html"); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)