Safari is not acknowledging the “required” attribute. How to fix it?
问题 <form id="customerForm"> <label> First Name: <input id="firstName" required /> </label> <label> Social Security Number: <input id="ssn" required pattern="^d{3}-d{2}-d{4}$" title="Expected pattern is ###-##-####" /> </label> <input type="submit" /> </form> When I try that document in Chrome, it accepts the conditions and shows the error, as expected. But when I try that document in Safari, it shows no error. 回答1: At this time, Safari doesn't support the "required" input attribute. http:/