pattern
is misspelled and you don't need to escape the - in the regex (take the forward slash out that is before the - ) ^\d{5}(-\d{4})?$
(and you might want to put a space before name
<p>Zip Code:<input pattern="^\d{5}(-\d{4})?$" name="zipcode" id="zipcode"></p>