我创建了一个通过 Duck Duck Go 搜索的搜索框,它工作得很好,但问题是当我点击搜索按钮而不在文本字段上输入任何内容时,它需要用户去鸭子去搜索主页,这是我不想要的. 有人可以帮我解决问题,以便当我点击搜索按钮而不输入任何内容时,页面保持不变这是代码:
<form class="form-search" method="get" action="https://duckduckgo.com/">
<input type="search" name="q" placeholder="Search or type web address">
<button type="submit">Search</button>
</form>