I'm working on an assignment for school where we're working with JavaScript (I'm only allowed to use JavaScript) to validate a form for a payment page. It's my first time working with JavaScript so and I feel a bit lost...

I'm faced with a task to validate the expiry date and the requirements are:

1. the number needs to be exactly 2-2 digits (in the format mm-yy)
2. mm needs to be >01 and <12
3. and the expiry date needs to be after today's date

So far I've only been able to specify the first two requirements and I have trouble figuring out how to check the date against today's date. 

html

```
<form>
<label for="expiryDate">Expiry Date</label>
<input type="text" name="expiryDate" id="expiryDate" />

<input type="submit" value="Check out" />
</form>

```

JavaScript

```
var expiryDate = document.getElementById("expiryDate").value;

if (!expiryDate.match(/^[0][1-9]|[1][0-2]-[0-9]{2}$/)){
    errMsg = errMsg + "The expiry date needs to be mm-yy and consist of a valid date.\n";
    result = false;
} 

```

So if anyone has an idea of how to help me, I would appreciate it!