Accept Declaimer after click on button

   <input type="checkbox"   id="confirm"> I have read and agree to this disclaimer as well as 
   <p class="d-none text-danger">Please read and agree to this disclaimer 
   above.</p>
   
   <button type="button" class="close" >Continue</button>

if does not checked checkbox then click on button the get error of p text and if checked the
checkbox then click on button then close popup