首页 > 解决方案 > 我如何“提示”提交按钮,以便当我填写表格并单击输入时它会提示它?)(仅在 JavaScript 中完成,没有 HTML/CSS 或 PHP)

问题描述

<form>
  <div class="nes-field">
    <label>
      I am interested in the following services (check all that apply):
    </label>
    <label>
      <input type="checkbox" class="nes-checkbox" id="full_redesign" /><span>Full website redesign using an 8-Bit theme</span>
    </label>
    <label>
      <input type="checkbox" class="nes-checkbox" id="sparkle" /><span>Sparkle cursors</span>
    </label>
    <label>
      <input type="checkbox" class="nes-checkbox" id="blink" /><span>Blinking text to attract customers</span>
    </label>
    <label>
      <input type="checkbox" class="nes-checkbox" id="music" /><span>Theme music to play when the user visits the page</span>
    </label>
    <label>
      <input type="checkbox" class="nes-checkbox" id="colors" /><span>Really bright colors</span>
    </label>
  </div>
  // here's the problem.
  <button type="button" class="nes-btn is-primary">Submit</button>
</form>

我正在尝试使提交按钮起作用,因此每当您填写表格并按下提交时,它都会提示它。

标签: javascriptbuttonsubmit

解决方案


推荐阅读