html5怎么通过输入指定文字跳转指定界面

html5怎么通过输入指定文字跳转指定界面
就是用户输入指定文字,跳转指定界面
如:
用户在输入框输入bing,跳转到https://bing.com/
用户在输入框输入google,跳转到https://google.com/

<html>
  <head>
    <meta charset="UTF-8">
    <title>跳转</title>
  </head>
  <body>
      <form>
  <label for="search">输入关键字:</label>
  <input type="text" id="search" name="search">
  <button type="submit">搜索</button>
</form>        
  </body>
  <script language="javascript">
    const form = document.querySelector('form');
form.addEventListener('submit', function(event) {
  event.preventDefault();
  const searchInput = document.querySelector('#search');
 window.location.href = 'https://'+searchInput.value+'.com/';
});
</script>
</html>  
您好,我是有问必答小助手,您的问题已经有小伙伴帮您解答,感谢您对有问必答的支持与关注!
PS:问答VIP年卡 【限时加赠:IT技术图书免费领】,了解详情>>> https://vip.csdn.net/askvip?utm_source=1146287632