Search code examples
htmlcheckboxrequired

If you click the check box in the html and click the button, you need to go to the next page, but it does not


this question is my first question. There are policies available in the site that I make, press the checkbox to accept it, eh button have to go to the next page, but I got the help I've run into even I do not know how it should be required but this is doesn't work

 <label for="myCheck">I agree:</label> 
<input type="checkbox" id="myCheck" required>
  <a href="img.html" class="btn btn-outline-success" role="button">Let's go</a>

Solution

  • if I understand your question well:

    The user have to check the input in order to let him go to img.html. if that´s the case you can do this:

      <form action="img.html">
    
        <input type="checkbox" id="myCheck" required> I agree policies
    
        <button type="submit">Let's go</button>
    
      </form>